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

Is it the domain layer coupled with database stuff? #1

Open
antunesleo opened this issue Mar 10, 2020 · 2 comments
Open

Is it the domain layer coupled with database stuff? #1

antunesleo opened this issue Mar 10, 2020 · 2 comments

Comments

@antunesleo
Copy link

Hello Ketan,

Found my self reading the blue book and looking for implementation examples, so I found your repository. I have a question for you. In the entity order (order_ddd_example/src/main/java/com/metamagic/ddd/entity/Order.java), Is it coupled with database stuff, right?

@PrimaryKey
@Persistent(column = "orderid", customValueStrategy="uuid")
private String orderId;

Shouldn't this stuff be in another place? I do ddd in the company I work for. We have to adapt a lot of the ddd stuff, but it worked for us. For study purposes, I'm trying to find a solution closer to the book. I found yours and it helps me a lot, specially in the repository part. but I didn't understand why you put this together.

@marccollin
Copy link

Everything in the domain layer should not use specific technology stuff: spring, orm..according to ddd

it's sure if your domain entity it's tempting to have the same structure in the db... otherwise, you need to create other object who will be the real mapping to the db...

@damnms
Copy link

damnms commented Sep 3, 2021

yeah and in the "api" package is spring stuff... thats a very technology driven approach and not really ddd

i'd like to have a "no-technology-model" that holds ONLY business logic, and not mixed with technology from third-parties. to achieve that, just split each package in its own project and see if it still compiles wihout all that third party deps.

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

No branches or pull requests

3 participants