views:

67

answers:

2

Having used DDD for a web site and finding it to be a neat approach, I'm wondering if this can/should be applied to desktop applications? Also, with the classes being separated into different packages, how could the MVC pattern be mixed in?

+1  A: 

Generally speaking, there is no reason why you should not use DDD for desktop/GUI applications. The problem you hint at is IMHO more of an architecture/design problem. Mainstream approach to build web applications today is the MVC architecture, however, in the GUI world, there is a component based architecture with event handling. You can build components out of MVC, i think Cocoa is done in such a way. Retrofitting components into MVC might be harder. The reason is that components/widgets often contain logic which should be split in views and controllers. However it is still possible, but it is up to you to decide if you really want to go into MVC, which is IMHO sort of lower level architecture than components.

Gabriel Ščerbák
+1  A: 

I find it difficult to implement DDD in rich applications namely because of how difficult it is to facilitate the controller because of the necessary listeners. I like using the Observer pattern in conjunction with Strategy where an Observer uses a Strategy object to operate on an Observable.

Droo