Hello everyone,
I have a question about DDD. I'm building a application to learn DDD and I have a question about layering. I have an application that works like this:
UI layer calls =>
Application Layer ->
Domain Layer ->
Database
Here is a small example of how the code looks:
//****************UI LAYER************************
//Us...
In DDD you should never let your entities enter an invalid state. That being said, how do you handle the validation of a unique constraint?
The creation of an entity is not a real problem. But let say you have an entity that must have a unique name and there is a thousand instances of this entity type - they are not in memory but stored...
Hye!
I have Aggregate object that have more than one level. Aggregate root is Network object and it have collection of Nodes and Links. Node and Link have collection of Segments, and Segment have collection of Lanes. My domain is traffic network and this is only part of this aggregate:
public class Network
{
private List<Node> nodes;
...
I have created a factory and a set of specifications to create and validate an aggregate root. Currently I have some tests for the factory that call the specifications on the product of the factory, but I'm wondering if that's enough. It might be better from a design perspective to couple the factory to the specifications of it's produ...
I am developing a spring mvc based application. I have a simple pojo form object, the problem is that many properties will be taked from drop down lists that are populated from lookup entities, so I return the entity ID to the form object.
public NewCarRequestForm {
private makeId; // this are selected from a drop down.
private...
hi, I'm new to DDD and i want to use entity framework v4.0 (shipped with .net 4.0) in my new project.
since i have few time to learn DDD and entity framework, which books are good for me to read first?!
i'm going to first read Domain-Driven Design Tackling Complexity in the Heart of Software by Eric Evan and next Pro Entity Framework 4...
I have an NH query which returns a Product with a BasePrice. Depending on various other factors, such as Manufacturer price markup, I use a PricingService on the C# side of things to produce a "final" price.
The issue is that I now need to query against this final value - i.e., I need to run a query that selects Products within a partic...
Assuming a typical domain entity approach with SQL Server and a dbml/L2S DAL with a logic layer on top of that:
In situations where lazy loading is not an option, I have settled on a convention where getting a list of entities does not also get each item's child entities (no loading), but getting a single entity does (eager loading).
...
Having used DDD for a web site and finding it to be a neat approach, I'm wondering if this can/should be applied to desktop applications? Also, with the classes being separated into different packages, how could the MVC pattern be mixed in?
...
Hi everybody
I'm begginer in asp.net mvc and i have some doubts.
P.S: I'm using DDD to learn
I have an ACtion in a Controller and it'll save an entity (from my model) by a repository (for a database).
My doubts is, How can I get the informations from the View and save it by a repository in my Controller ?
Is it correct to get an enti...
I have a scenario in which I need advice on. I have an application where there are two kinds of users Student and Teacher. Student and Teacher share some of the common properties like FirstName, LastName, Email, UserName, Password etc. For this reason I derive Student and Teacher classes from User.
Now, the problem is that there are ti...
Hi all, i'd like to know how can I get a property like an entity, for example:
My Model:
public class Product {
public int Id { get; set; }
public string Name { get; set; }
public Category Category { get; set; }
}
View:
Name: <%=Html.TextBoxFor(x => x.Name) %>
Category: <%= Html.DropDownList("Category", IEnumerable<Select...
I am trying to practice the model first approach and I am putting together a domain model. My requirement is pretty simple: UserSession can have multiple ShoppingCartItems.
I should start off by saying that I am going to apply the domain model interfaces to Linq2Sql generated entities (using partial classes). My requirement translates i...
I'm importing data that may or may not exist already in my database. I'd like NHibernate to associate any entities with the existing db one if it exists (probably just setting the primary key/id), or create a new one if it doesn't. I'm using S#arp architecture for my framework (MVC 2, NHibernate, Fluent).
I've added the [HasUniqueDoma...
I like the way NCommon saves me from dealing with all the plumbing required to do DDD with NHibernate.
I like it so much that it I am seriously considering it to be part of my default architecture in new projects.
I'd like to ask if there are other DDD alternatives (aside from coding from scratch) to what NCommon does.
Thanks.
...
we are designing a application with WPF/WCF... where we had lot of business leaked into the client code so inorder to avoid and make it clear we want to use the Domain Driven design . But where exactly my domain model will Sit .. in Server or client.
Note :To explain more about architecture
we have WPF with MVVM we are bin...
I have a model that looks like this:
public interface IEntity
{
int Id { get; set; }
}
Then the idea is to have my entities inherit from this interface:
public class User : IEntity
{
public int Id { get; set; }
}
However, one of my entities actually has a Guid as an identifier.
public class UserSession
{
public Guid Id...
Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die.
Class Person
{
Void Feed(Rabbit r);
Void Buy(Rabbit r...
There are some queries used by a DAO layer that is implemented in JDBC Template
String longQuery = ".....";
public List<AnObject> findObjectsBySomething(Something s) {
return getJdbcTemplate().queryForObjects(longQuery, myRowMapper, s);
}
longQuery is going to frequently change, but I don't want to have to manage it right in the s...
I have a root object that has a property that is a collection.
For example:
I have a Shelf object that has Books.
// Now
public class Shelf
{
public ICollection<Book> Books {get; set;}
}
// Want
public class Shelf
{
public IQueryable<Book> Books {get;set;}
}
What I want to accomplish is to return a collection that is IQu...