ASP.NET MVC and DDD

2

I'm trying to use DDD and Fluent Api in a test application. I had the following question:

I have a product registration (in this case ink), when adding a new product I put dropdownlist's, to force the correct and standardized registration, ex: White RAL 9003 LI BR PO, this acronym and color comes from dropdownlist S, and I want to save in a "description" field, because in the index page I will only show this description.

I thought of doing so: put the description field as readonly and as you select the dropdownlist's items it will fill the description field, using javascripts, however I think it will hurt the DDD rule.

Is it okay to do this or is there another better way? If there is a more correct way, what would it be? Which layer would put this routine?

    
asked by anonymous 20.08.2015 / 18:40

1 answer

1

Following the DDD standard, business rules always stay in the Domain layer.

"Domain - represents the concepts, rules and business logic." The whole focus of DDD lies on this layer, and our work hereafter will deepen and deepen that part. " (DANIEL CUKIER)

If you have to evaluate this description rule is a business rule, if the user changes this description by Html and the application finishes recording this information, will this affect the system?

I would do the following, I would create a method on my Domain layer that gets the information needed to assemble the description. When saving the information your save method will call again the method to create the description. This ensures that the description of your product will always follow the same pattern.

    
24.08.2015 / 14:14