Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ValueObjects for different entities should be avoid? #115

Closed
leandrofagundes opened this issue Nov 24, 2019 · 1 comment
Closed

Using ValueObjects for different entities should be avoid? #115

leandrofagundes opened this issue Nov 24, 2019 · 1 comment
Assignees
Labels

Comments

@leandrofagundes
Copy link

If we add a Bank Entity where Bank should have a Name property, should it be the same Name of Customer?

But if the rules of Customer or Bank should have an additional implementation like: Bank Name should have only 10 characters, should we build UserName VO and BankName VO?

@ivanpaulovich
Copy link
Owner

Hey @leandrofagundes,

I suggest the TDD Outside-In approach. Design the API from the UseCases usage, deffer ValueObjects because they can change a lot in the earlier stages. So start with primitive types like string, int and bool.

I consider the Value Objects very specific to the Entity they are part of. These should be separated in BankName and CustomerName value objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants