Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

Initial design question on an ASP.NET Core MVC project.

$
0
0
I am starting on a project, together with other developers. The customer is a community and wants to have a website where people can apply for a service. According to their family status, the persons are being distinguished into cases, i.e. married, divorced, living together with a partner, widow. For every case there exist some different questions, although most of them are common (like bitrhday place, father name and so on). The technology used is ASP.NET Core MVC.

The one proposition is to make a model, a controller and a view for every family status. The name of the classes should accordingly change, like MarriedModel.cs, MarriedController.cs, or DivorcedModel.cs, DivorcedController.cs etc.

My approach is a more OOP one. Since we have an entity of a Person, this is our model class. Family status, liked married, divorced etc, consists an attribute. The actions should change dynamically passing the attribute parameter into the controller which would control the view appropriate.

I find that this way we avoid redundancy and code copying, which is very bad enginnering. Moreover we have less code in the end. Others say that with the first way we would gain on flexibility in case something changes during developement.

What do you think?

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>