asp.net mvc - Using MS MVC and DDD, How and where to define a MVC ActionMethod parameter class that involves an entity, a value object, and a few extra fields? -
I'm just on the verge of "ah ah"! When it comes to domain driven design coding Question How and where to define an MVC Action Mathi parameter class, which includes a unit, a value object, and some additional fields? The unit and value object class is defined in my repository.
Do I:
- To apply other classes (to get all the properties of one class), create a custom class in the repository, and add additional Add some more properties for the field?
- Create an Entity / Well Object Poko class in a repository and create a composite class referencing these objects in my Controller class, then use it as the ActionMethod parameter type?
- Something else?
The request form only collects certain customer class areas, mailing addresses, and some form attributes, such as how we find materials are not important, only they contain information about several Pokas.
I know that MVC will match the properties of Poko in the parameters of the post form as in the following:
Therefore customer.firstName
[AcceptVerbs (HttpVerbs.Post)] Public Action Requests List (String Finem, String Laeman,
But want to do something like this:
[AcceptVerbs (Any ideas?) " >
Firstly, you should be realistic to assume that the domain model should be defined independently of run-time framework (MVC) in the future, in the future, you should design the domain model as a WCF service, or a WPF / Silverlight should be able to appear as rich customer, or job of batch, or something ...
This means that all models should be uncontrolled by the technical details Sector data and domain characteristics of being consumed objects (especially) the design process should be ignored at this stage how the store.
You should always ask yourself: Is this class understood as a part of the net domain?
In a specific case in you, most of your input seems like it is similar to a customer class, which has the same structure
public class customer {public String firstname {get; Set; } Public String LastName {get; Set; } Public string phone {get; Set; } Public Address Address {get; Set; }}
and the address class is defined similarly.
Now you need to ask yourself (or the domain experts you are working with) to ask: What is the howrefound use
on the customer class? Or is there a domain concept in itself? Or is it really just a piece of application-specific data on which there is nothing with the domain model? The answers to such questions will guide you on how to eliminate the modeling of your input.
On the one hand, the top phone property looks suspicious to me, but there is a great example of how the implementation details (in this case, the ASP .NET MVC) could leak in the model.
A phone number should actually be a value object in itself (see for the related treatment of this topic), but ASP.NET's default model builder is a primary option implemented to implement a custom modlinder. Which will parse a proper phone number.
Comments
Post a Comment