-
Notifications
You must be signed in to change notification settings - Fork 0
Description
We can ease creation of entity classes by generating abstract bases that would take work of specifying generic parameters. For example, for an entity state called NumberStats (which has the kind PROJECTION) it would be like this:
internal abstract class PNumberStats : Projection<Int, NumberStats, NumberStats.Builder>()This way, the user would be able to start his NumberStatsView or NumberStatsProjection like this:
internal class NumberStatsView : PNumberStats() {
...
}Please note the P prefix of the generated abstract base. It's meant to give the developer information about the kind of the entity.
So, we can have A for Aggregate, and Pm for ProcessManager.
I suggest generating such abstract bases only for Kotlin, assembling them into a file called EntityClassesKt.kt.
internal access
Please note the internal modifier set for the generated abstract base. This way we force the derived class to be internal as well.