I've commonly seen examples like this on business objects:
public void Save()
{
if(this.id > 0)
{
ThingyRepository.UpdateThingy(this);
}
else
{
int id = 0;
ThingyRepository.AddThingy(this, out id);
this.id = id;
}
}
So why here, on the business object? This seems l...
Actually i'm pretty confused about this terms and how they relate to each other. A read something about every one of them but i don't uderstant the work flow..
DTO - Data transfer object - object to transport values
BO Business object - object in domain model. object to make Business logic with
POCO - no idea, i've read a definition on ...
I bump into this from time to time during class design... when I have several properties of the same type in the object. Take few examples:
User has several addresses. We can do
IDictionary<string, Address> Addresses; // Addresses["BusinessAddress"];
or
Address BusinessAddress;
Address ShippingAddress;
Product has related product...
I keep seeing DDD (Domain Driven Design) being used a lot in articles and people talking about ASP.NET - I have read the Wikipedia entry about DDD but still can't figure out what it actually is and how I would go about implementing it in creating my sites?
...
Using LINQ TO SQL as the underpinning of a Repository-based solution. My implementation is as follows:
IRepository
FindAll
FindByID
Insert
Update
Delete
Then I have extension methods that are used to query the results as such:
WhereSomethingEqualsTrue() ...
My question is as follows:
My Users repository has N roles. Do I create...
I have a complex, 3NF database being provided to me for a particular project. I would like to avoid using a class-per-table domain design. Rather, I would like to model my domain objects after how they are used from a conceptual business perspective.
The rub is how to properly persist this information. I know I can go the ADO route, ...
Hi people,
Im fairly sure this will have been asked before but I haven't found the answer. I have an account object that creates a user like so;
public class Account
{
public ICollection Users { get; set; }
public User CreateUser(string email)
{
User user = new User(email);
user.Account = this;
Us...
Background
Each Project has one Account it is associated with. Each User can have permission to access zero to many Accounts. This in turn means that each User can only access a sub-set of Projects based on the User's Account permissions.
The User object is loaded up when the user signs in to the application, and Account permissions are...
I was looking at the null object pattern and i am wondering if it worths implementing it or use "if" checks for nulls in my code intsead. As i looked at the implementations it seems hard to keep objects well synchronized with their null implementations. By making changes to the main object we have to check that the null object behaves as...
Which approach is recommended in a DDD world... and why ?
aggregateRoot.Items.Add(...)
aggregateRoot.AddItem(...)
I think the first option is better since it is more related to the ubiquitous language.
Should I expose a readonly (IEnumerable) collection and some AddItem()/RemoveItem()/etc on the aggregateRoot (option 1) or expose a ...
I know that we should only create repositories for Aggregate Roots and not for the entities it aggregates. Should I apply the same logic to MVC, e.g., have a Controller/PageView for an Aggregate Root and then a/some PartialView/PartialAction for the sub-entities.
Please illustrate your answer with the famous Order/OrderLine example.
I ...
I have a domain Aggregate, call it "Order" that contains a List of OrderLines. The Order keeps track of the sum of the Amount on the Order Lines. The customer has a running "credit" balance that they can order from that is calculated by summing the history of their database transactions. Once they use up all the money in the "pool" they ...
I am working on an application where I can have Teacher, Student etc role. Some of the functionality is similar so I also have a base class User. User contains AddRole method and other stuff.
Now, I want that when the Teacher object is created the "Teacher" role is automatically assigned to the object. I am doing this inside the constr...
I am working with a legacy system that has an anemic domain model.
The domain has the following entity classses: Car, CarType, CarComponent, CarComponentType.
For each of these, there is a separate repository. There is also a number of services that access these repositories and contain basically all logic.
I need to implement a metho...
Hi there,
While working on the login part of an application, I find myself running into an issue:
My model is based on Active Record, by extending Zend_Db_Table_Row objects. Whenever I have to deal with a user, I'd want to do this through the User object (being an extended table row). However, Zend_Auth_Adapter_DbTable::getResultRowO...
I wanted to get opinions on a jQuery plugin I've bee working on to display an international address form. I posted it on my blog at http://weblogs.asp.net/awilinsk/archive/2009/08/13/jquery-amp-international-address-data-collecting-and-storing.aspx.
I have searched around here and all over the internet to get some insight on how to solv...
This is one thing that has been bugging me for a while about DDD. I can clearly see the benefits of the approach when dealing with non-technical business domains with complex models and lots of interaction required between technical people and non-technical domain experts.
However, what about when the 'domain' in question is technica...
I'm thinking of implementing a Domain Driven Design approach (similar to the one described here), but want to integrate it with the Doctrine ORM. Has anyone had any success doing anything like this?
My initial instinct was to use Doctrine as the DAO layer, but it seems a a bit convoluted for Doctrine to map my database fields, and my en...
Can anyone show me simple CRUD statements for aggregate root using traditional ado.net?
Thanks in advance!
...
I came across the term "domain object" and found a couple of definitions on Google but I just want to verify that my understanding is correct.
Is this simply any class that represents business rules - since the word 'domain' usually means rules that are specific to some local problem set such as how to calculate income taxes.
So the ...