Inside Paulo Abrantes' head
[ start | index | login or register ]
start > comment-start > 2007-02-28 > 1-9

1-9 commented start/2007-02-28/1

Created by m4ktub. Last edited by m4ktub, one year and 153 days ago. Viewed 489 times. #4
[diff] [history] [edit] [rdf]
labels
attachments
I think we are approaching two distinct, yet closely related, subjects:
  1. The use of DDD
  2. Persistence of an OO model
This distinction is important to clarify things as we can have the first without the second (bare with me) and the second without the first. We can also have the first with an OO DB which changes many of the assumptions made.

Now, considering searches over the graph of objects composing the OO model resulting of a DDD.

I don't think the Search<DomainObject> concept that João described above was completly understood. The suggestion was to consider a view in a database as a regular table. So, if your persistence framework maps objects to tables, it can map and object into a view. If you then ask the framework to provide all objects of that type (a readAll) it will provide objects representing the result of a complex query "transparently".

A simple example: a bank. Lets assume that the core of the bank's domain is the relation between accounts and their owners. But "Customer" is also a relevant concept for us (the bank) and we want to decide between those customers that we would rather loose and those customers we want to keep.

ddd-example-1

I've just invented a stereotype in the example to mark those domain concepts that we will map into a view. But I believe that they are domain concepts with the same relevance as the others. They just have different domain rules. For example "a TerribleCustomer can't open any more accounts" o "a PremiumCustomer has +1% in the interest rate". The fact that these domain classes can be implemented in the database as two views it's problably only an optimization.

But this isn't the main problem enounced here.

The traversal of the object graph corresponding to the application's domain is more inefficient than direct query in a database and materialization of the result set over a database.

Well, I believe that is more inefficient if you are doing a complex (several levels deep) search, most of the graph is not in memory, and you need to materialize those intermediate objects to do the traversal. If the intended query is just 1 or two levels deep then processor speed higly overcomes the network latency/traffic normally associated with the communication to a database. Offcourse I have to do some tests to back this up (all those Prevayler related tests are out of date and unrealistic).

24 comments (by jpmsi, m4ktub, pabrantes) | post comment
Who am I?
paulo-roca2My name is Paulo Abrantes AKA pabrantes and I'm a software developer. I'm currently employed at >>CIIST working as a Java developer in >>FenixEDU.

This blog is mostly about Java programming, domain driven design and snipsnap bliki developing. Everything written in this blog is my personal opinion and it may not reflect the opinions of my employer and co-workers.


Blog subscription
subscribe by rss subscribe by email

Links
>> Home
>> Paulo's Profile
>> Post History
>> Add to Technorati Favorites
>> Paulo's Photo Gallery
>> WishList
>> Posting without Login

Search Blog
Fellow Bloggers

Recent Posts

Java Programming: Bytecode Injection
Intermission: Sorry For Downtime
Software Developing: Studying The Bliki Domain Model
SnipSnap Developing: Trying to settle a roadmap
System Administration: Load Balancing with Apache
Blogging: Two years have passed
Software Developing: The SnipSnap Saga
Java Programming: Getting your code spicy with Groovy
Software Developing: Fluent Interfaces
Software Developing: Implementing a ShoutBox on SnipsSnip
Software Developing: SnipSnap, SnipIt and SnipSnip
Java Programming: Proxies and Access Control
Java Programming: Proxies and References
Java Programming: References' Package
YALM: Yet Another Layout Modification

For older posts, please refer to post-history for a complete Post History

Logged in Users: (0)
… and 5 Guests.
This is a modified version of snipsnap.org created by >>Paulo Abrantes