Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For you first question, I want to comment and help you with some humble design guidance. Humble meaning believe it at your own risk :D.</p> <p>While designing classes for any layer or any type of software I usually approach it with generalization love (abstraction/interface contracting etc), You mentioned you have name and description which are 'values' that are going to be added to your domain models core object such as 'SkillTree' or 'Character', Ask yourself if you can generalize name and description classes as for example IAdditiveInformation interface. If most of what these two classes will do can be shared/contracted under IAdditiveInfromation generalization then you know that this is also in your domain core. If you use this interface in core of your domain model and point all dependencies towards this interface you wont have to answer hard and speculative design questions such as</p> <ul> <li>Will I be adding more 'value' classes? </li> <li>Will there be more 'GamePart' classes?</li> <li>How can I design my 'value' and 'GamePart' classes so that I can implement their interaction with minimum effort.</li> </ul> <p>For deciding classes to put at Domain model, Domain service or Application Layer and beyond. I use these as guidelines.</p> <ul> <li>If a class is directly related to what your software is on like in a way that a account software is related to invoices, inseparable and crippled without it, then that class is in your domain model layer and at the core of the onion.</li> <li>If a class operate on objects at your core and only on your domain core and they are reusable whenever you use a domain core like the current core. Then they are your domain services. </li> <li>If a class operates on your domain services and/or your domain core and it feels a little bit more specialized for that application. Then it probably belongs into application layer. For something to be in application layer remember that this functionality should be critical for that particular application on domain and not for whole the domain. So you only need this functionality for that application.</li> </ul> <p>Let me give you an example to make it a little easier to understand. </p> <p>Imagine a gps based tracking system. </p> <ul> <li>At it's core there is a class called GPSTrackable (an abstract class hopefully).</li> <li>At the domain service level there is a class which operates/depends on GPSTrackable which is a geo location based query control where you give a GPS box and it returns you GPS trackables in that box. Lets call this class GPSTrackableQuery</li> </ul> <p>Time to see magic of onion/DDD and correct OOD :). I have not told you what the application is and I have not even decided on the application yet. I don't have decide to capture core domain and domain services because they should be application independent(in an idealized architecture way). </p> <p>Now with these at our onion core, </p> <ul> <li>I can make a class in application layer, that calls to GPSTrackableQuery every 10 seconds and checks if there are any object in close proximity to a military base for a security system and you get a location based security system if you run that core at everyone’s phone.</li> <li>I can make a class in application layer, that calls to GPSTrackableQuery when user wants to send mass SMS or e-mails to people near his store. Now I made a advertisement system from the same domain core.</li> </ul> <p>You can add new examples to this. This is a simple thing, I imagine when I doubt my decisions. </p> <p>One last note: You should also understand that placement of classes in layers have no meaning. We just put them in 'virtual' layers to have a feeling of their responsibilities and functional scope. If in too much doubt just put it somewhere, when you architecture or design or implementation evolves you will feel it's correct placement. </p> <p>For your second question. </p> <p>In my opinion, your suggestion is correct. Only thing I can comment is I would not use the term sphere of knowledge for the domain layer(I assume you mean both domain core and domain services). I view domain core as a representation of real world knowledge in computer terms or core idea's behind it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload