Saturday, June 23, 2007

Domain Driven Design

NFJS June 23, Venkat Subramaniam

Model needs to focus on the domain, not the implementation. This is a big problem with the way people think about MVC--too many people think model means database or persistence. But that's an implementation issue. Model must also include behavior and even (gasp!) business logic.

I know I'm guilty of sloppy thinking here. A lot of that was driven by J2EE, where no one put any behavior in the entity objects other than persistence. And to this day, even with other frameworks like Struts and Spring, people still think of "session" objects as owning behavior. Which of course defeats the entire purpose of object-oriented design, where behavior is supposed to live with state.

Paraphrase: "Two major problems: framework and design pattern." Both concepts get abused beyond reason.