If I'm developing a hiberante application, am I also developing a DD model?
My application does have a service layer ( which is in lines with the Observer pattern). Will there also be a Domain Layer wherein all the hibernate entities exist?
I'm looking my application somehting like this:
Do I need to know Domain Driven Design to write Hibernate Entities?
Can the application be hybrid - OOD in the service layer and DDD in the persistence layer?
I'm confused. Please clarify.
Domain model "is-an" entity @Entity @Table(name = "agent") class Agent { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Column(name = "agent_number", unique = true, nullable = false) private String agentNumber; @Column(name = "agent_name", nullable = false) private String agentName; // ...
Domain-Driven Design (DDD) is a set of principles and tools that helps us design effective software architectures to deliver higher business value.
If I'm developing an Hibernate application, am I also developing a DD model?
When using Hibernate, you'll probably create a domain model of entities and do some domain modeling but you aren't necessarily following Domain-Driven Design principles, there is no direct implication. And actually, I'm tempted to say that it's most often the contrary, most Hibernate applications end up having an anemic domain model.
Do I need to know Domain Driven Design to write Hibernate Entities?
No. there is no particular knowledge to have to write Entities. However, if you want to follow DDD, you obviously need to have some knowledge of DDD. And if you want to go this direction, using Hibernate (as your factory for entities) has some implications on the implementation. Domain-Driven Design with Spring and Hibernate is a very nice blog post on the topic and describes an AOP based approach.
Domain-Driven Design Quickly (great summary book of Eric Evans's reference book).
Chris Richardson's aop-ood sample application
actually DDD is an approach and is not tied to the tools that you are using.
you can use Hibernate or any other OR mappers to do DDD or any other aspects that you thins is suitable for your case.
read more about DDD: http://en.wikipedia.org/wiki/Domain-driven_design
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With