Open Closed

Value object support for GRUD generation #1406


User avatar
0
LW created
  • ABP Framework version: v4.3.1
  • UI type: Angula
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Is the generation going to support Value Objects at some point? What would be the suggested way to generate the entites and then form value object to the entites afterwards at this point? How would you deliver value object data through the API: as a separate dto object or with properties inside the entity's dto class?


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi @albert

    What do you think?

  • User Avatar
    0
    alper created
    Support Team Director

    at this point there's no plan to support value objects (very limited usage in the community). but you can create an entity with an Id field with Suite don't generate the migrations then remove the Id field and make it value object according to https://docs.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/implement-value-objects

    finally you can add the migration

  • User Avatar
    0
    LW created

    Hi Albert, thank you for the answer. We tried it that way but the problem with that approach is that it's not easy to populate all the value object data to a grid showing parent entity's data. Going the other route and defining the value object's properties separaterly to the parent entity and then changing backend code to form a value object, also needs a lot of customization to the generated code. Either way having to change the code after generation ruins the maintainability of the entity (with suite). Thus we desided not to use Value Objects at this point and describe the data as separate properties inside the parent entity. Unfortunately this deficit undermines our domain model a bit :(

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09