Domain Driven Design with AOP and DI
Domain Driven Design (DDD) suggests dealing with complex software system using a domain model and preserving the model in implementation. Since domain model entities have rich behavior, so should their software implementation artifacts. A direct mapping between domain model and software artifacts create simple-to- understand, inexpensive-to-implement, and easy-to-evolve systems.
While the idea behind DDD isn't new and the value is easily understood, many implementations do not adhere to its principles. This disconnection may be due to many obstacles in implementing it. Combining Dependency Injection (DI) with a full-fledged aspect-oriented programming (AOP) system such as AspectJ help overcome many obstacles.
The traditional DI mechanism allows injecting dependencies into coarse-grained objects such as services exposed to the application level. However, it cannot do the same for fine-grained domain objects, which are not exposed in the same manner. The DI and AOP combination overcomes this limitation allowing creation a web of domain objects mirroring the model. Now domain classes can implement rich behavior by collaborating with dependent objects, instead of acting as mere data carriers. Further, domain concepts such as security, change tracking, and business rules are crosscutting in nature. AOP allows expressing these concepts directly using aspects.
In this session, we will examine the need for domain driven design, obstacles in achieving it, the basics of enabling behavior-richness for domain objects, and patterns of usages. This session will also present several examples that show the power behind the techniques. The knowledge gained through this session will enable you to readily apply domain driven design in your systems.
About Ramnivas Laddad
Ramnivas Laddad is a well-known expert in enterprise Java, especially in the area of AOP and Spring. He is a Spring Framework and Cloud Foundry committer. Ramnivas is also the author of AspectJ in Action, the best-selling book on AOP and AspectJ that has been lauded by industry experts for its presentation of practical and innovative AOP applications to solve real-world problems. He has spoken at many leading industry events including JavaOne, JavaPolis, No Fluff Just Stuff, SpringOne, and O'Reilly OSCON. In recent years, Ramnivas has become a Scala fan. Ramnivas lives in the Silicon Valley.
More About Ramnivas »