domain-model

Decoupling the model and input checking

Is it a good practise to decouple input checking from a model and have it handled elsewhere, say by a controller? If so, how could this be done from an MVC or DDD standpoint? It is a good practice to perform UI validation. E.g. if Your domain object expects date time, it is correct if UI part of...

Is lots of add/change methods and constructor overloads a consequence of DDD?

I have a class: public class Person { public string FirstName { get; private set; } public string LastName { get; private set; } public string Email { get; private set; } public string Telephone { get; private set; } public Address Address { get; private set; } public Person(string firstName, string...

ASP.NET MVC - view model, domain model and data model [closed]

I am using entity framework in my latest ASP.NET MVC 3 project. As it is DB first, the entity framework generates Database models . In my service (business) layer I Scaffold (MvcScaffolding) to generate service methods, views and controllers. Scaffolding also generates the domain models . When...

NHibernate many-to-many assocations making both ends as a parent by using a relationship entity in the Domain Model

Entities: Team <-> TeamEmployee <-> Employee Requirements: A Team and an Employee can exist without its counterpart. In the Team-TeamEmployee relation the Team is responsible (parent) [using later a TeamRepository]. In the Employee-TeamEmployee relation the Employee is responsible (parent) [using...

Is it possible to reuse the DataAnnotations in ViewModel?

In my MVC application, I defined the DataAnnotations in the domain models. Although the DataAnnotations properties as Display, etc. can be retrieved when using Domain model, they cannot be retrieved when using the same properties on ViewModel and using this ViewModel. I think it is not seem to good...

What is the best database structure for this scenario?

I have a database that is holding real estate MLS (Multiple Listing Service) data. Currently, I have a single table that holds all the listing attributes (price, address, sqft, etc.). There are several different property types (residential, commercial, rental, income, land, etc.) and each property...