Skip to content

Generate abstract base classes for entities together with entity states #26

@alexander-yevsyukov

Description

@alexander-yevsyukov

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.

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions