Within Clean Architecture, the Domain layer defines Use Cases which define operations which can be performed in our application. In this lesson, we’ll be implementing the Bookmark Project Use Cases class for our application so that we can bookmark a project within our external data source through our domain layer.
This lesson should be before "Implementing the get Bookmarked Projects use case".
Can you explains why you're building a companion object in the Params class?
Sure thing! Because the use case classes are used within our view models, we need a way to kick off the work performed by the use case with some parameters. The Params class allows us to keep our buildUseCase() functions abstract (they need to be as all of our classes extend from the base use case classes). The reason for it being in a companion object is so that we can call the parameters function that we define within it - this way in future we can easily have multiple parameter functions incase we want to change the different parameters that are passed into the use case class. This keeps the constructor of the Params class private and enforces the parameters that can be passed into the class using these functions.