domain-model

Using app-level settings in rich domain models

I want to have a global/app level setting that I want to use in my rich domain models. I have a method that does some calculations based on the argument passed. This might not be the best example and might not look like a method belonging to the domain model but I try to keep it simple so you could...

Loading related objects in memory (without an ORM)

I am using ADO.NET to read a bunch of data from the database into in-memory objects. This is my domain model: // Question.cs public class Question { public int ID { get; set; } public string Title { get; set; } public string Description { get; set; } public IEnumerable<Tag> Tags { get; set; } } //...

What is the difference between conceptual domain models, application class models, and consolidated class models?

I need to make these three UML diagrams for a class project, but they all seem like the exact same thing, a class diagram. The difference is the level of abstraction those models deal with the reality they try to reflect. The conceptual model is just a rough draft of the domain. You try to gather...

Adding code to Entity Framework 4 generated POCOs

Starting from an EF 4 entity diagram and using T4 templates one can create POCO classes that can be used inside the Domain Model. The generated code looks like this: public partial class Product { public virtual int Id { get; set; } public virtual string Name { get; set; } //and so on } Is there any...

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...