When do domain concepts become application constructs?
        Posted  
        
            by 
                Noren
            
        on Programmers
        
        See other posts from Programmers
        
            or by Noren
        
        
        
        Published on 2012-12-12T16:26:07Z
        Indexed on 
            2012/12/12
            17:18 UTC
        
        
        Read the original article
        Hit count: 391
        
I recently posted a question regarding recovering a DDD architecture that became an anemic domain model into a multitier architecture and this question is a follow-on of sorts.
My question is when do domain concepts become application constructs.
My application is a local client C# 4/WPF with the following architecture:
Presentation Layer
- Views
- ViewModels
Business Layer
- ???
Domain Layer
- Classes that take the POCOs with primitive types and create domain concepts (e.g. image, layer, etc)
- Sanity checks values (e.g. image width > 0)
- Interfaces for DTOs
- Interface for a repository that abstracts the filesystem
Data Access Layer
- Classes that parse the proprietary binary files into POCOs with primitive types by explicit knowledge of the file format
- Implementation of domain DTOs
- Implementation of domain repository class
Local Filesystem
- Proprietary binary files
When does the MyImageType domain class with Int32 width, height, and Int32[] pixels become a System.Windows.Media.ImageDrawing? If I put it in the domain layer, it seems like implemenation details are being leaked (what if I didn't want to use WPF?). If I put it in the presentation layer, it seems like it's doing too much. If I create a business layer, it seems like it would be doing too little since there are few "rules" given the CRUD nature of the application.
I think all of my reading has lead to analysis paralysis, so I thought fresh eyes might lend some perspective.
© Programmers or respective owner