Setting the scene - When identity matters

1 06 2008

Typically the objects in a domain model can be categorized into 2 types: entities and value objects. Both of these can be implemented as regular CLS objects with properties and methods, they represent domain concepts and provide methods that manipulate the internal state. So what’s the difference then? Well, some objects require specific identity management, where a mistake in identity can lead to data corruption. Can you imagine assigning a million dollar contract to the wrong business partner? Obviously a BusinessPartner requires carefull identity management to prevent catastrophic errors in the system. These kinds of objects are called entities.

Remember that objects, when they are in memory, are identified by their memory address and not some property that acts as an identifier like this is the case in a relational database. The underlying infrastructure must ensure that the two are mapped to one another, which is often done using the identity map design pattern. Implementing such an infrastructure can be a pretty daunting task, but if you are interested, I have created an entire series of blog posts last year which covers most of the difficulties that you will encounter. Or, you could use an Object Relational Mapper instead.

On the other hand, a domain model contains a lot of Value Objects as well, which will be covered in the next post.

Stay tuned,
Yves


Actions

Information

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Short Changed l


You’re in the waiting room on a Monday morning, its 20 minutes past your 10:30 a.m. appointment and you’re getting a little testy. You’ve skimmed People magazine and now you’re looking at the floral prints on the walls. The same prints you’ve been forced to look at when you’re on time and your doctor is [..]


Nutrition For Your Sight: Better Vision Through Better Nutrition


Each day gets dimmer. Each night turns darker. Each decade looks fuzzier. Is it old age? Is it reading in the dark? Or, Is it just bad nutrition? Read further for the top vision preserving nutrients. How many times has your optometrist asked you about your diet? Often, nutrition is an overlooked solution to future eye [..]


Circuit Training for a Change of Pace


Try circuit training to get or keep you fit when you’re short of workout time. Circuit training consists of going quickly from one exercise to another for an extended period of time, say 20 minutes. It is promoted as giving both strength and aerobic training in the same workout. It does that, but you compromise both. [..]


Decreasing the Incidence of Work-Related Back Injury


Many of us spend many a long hour each day sitting at a desk and working on a computer. Do you sit in the right position? Think about how you sit. It’s common that the longer you sit, the more you will find that you are slumping in the chair. This causes the bottom of [..]


Leave Men Alone


Some men should not be left alone. Not because we don’t trust them. Not because they can’t find anything when you are gone. There is another reason. If you do, what happens is this: bad things happen. At least, this is what my wonderful husband says when I go off on a plane somewhere. He’s not the [..]


All News