2
I am trying to use DDD and Fluent Api in a test application. I have the following question:
I have a product register (in this case ink), when including a new product I put dropdownlist s, to force the correct and standardized registration, ex: White RAL 9003 LI BR PO, these acronyms and the color comes from dropdownlist s, and I want to save in a field "description"because on the index page I will show only this description.
I thought to do so: put the description field as readonly and as it is selecting the dropdownlist items it will fill the description field, using Avascripts, but I think it will hurt the DDD rule.
Is it right to do so or is there another way better? If there is another way more correct, what would it be? Which layer would put this routine?
Please read this before: http://answall.com/questions/78716/howto extend pocos-do-entity-framework-encapsulando-as-regras-de-neg%C3%B3cio
– Leonel Sanches da Silva
So you have a paint registration and a color registration and will create a new product from the combination of these two registrations, and the new product will have a "description" attribute concatenating the name of the two selected items? The weird thing I see there is replicated information (redundancy). If redundancy is no problem and if for the Product entity what is worth is that a description has been informed; the fact that this description has been facilitated for the user is not a problem.
– Caffé
Now, if you have in the Product the "description" field just to facilitate the display of information that is obtained from other product attributes (ink and color), then it is wrong. You should take care of these display details when displaying instead of redundancy information in the entity. Something else: where DDD comes in?
– Caffé
Caffé, good night to you! So the problem is this, let’s take an example of White Smooth Shiny Polyester paint, I want to force a standardization because in the old register that has been registered only White Paint. And the rest of the information, I believe that by doing so I can force a standardized record.
– Heitor H. Sichin