Note that there are some explanatory texts on larger screens.

plurals
  1. PODomain Driven Design - External Data API as Respository or Service
    primarykey
    data
    text
    <p>In a blog application developed using domain driven design a 'Post' entity has a related collection of tag entities. </p> <p>On creating the post (e.g populating the object from the UI) i would like to call a third party API via REST which takes the content of the post and extracts semantic tags (<a href="http://www.opencalais.com/" rel="noreferrer">link text</a>) for association.</p> <p><strong>Main Question</strong> : What is the best way to design this...</p> <p>Is it best designed so that the Post entity would call a domain service such as PostServices.GetTags(Postcontent) passing its content and retrieving back a list of tags.?</p> <p>** PostServices.GetTags would then inteface with the REST API via a further wrapper class.</p> <p>Or should the third party API be wrapped as a repository?</p> <p>Should the function Post.GenerateTags(), should not exist within the domain entity at all?</p> <p><strong><em>Further questions</em></strong> :</p> <p>1 : I have also read that it is not good practice to have a domain entity converse with a domain service. Is this true?</p> <p>2 : Is it ok to get a reference to the PostServices domain service via a factory creation method. e.g...</p> <p>IPostService PostService = ServiceUtil.GetPostService(); return PostService.GetTags(Post.content);</p> <p>3 : Is it acceptable to have the domain service coupled to a third party api?</p> <p>4 : Should the domain entity simply just know how to deal with the tags received via the application layer which has called the REST API.</p> <p>Slowly trying to get my head around DDD, however I can't seem to find any examples of how to implement this sort of thing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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