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

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

Created by jpmsi. Last edited by jpmsi, one year and 150 days ago. Viewed 467 times. #3
[diff] [history] [edit] [rdf]
labels
attachments
I'm sorry I didn't quite follow you here. The database already had made the materialization? We're talking about relational databases there's no concept of materializing an object. I must have misunderstood something about what you were saying. Could you please clarify?
When I talked about this kind of materialization I was talking about the DB engine following relations (joining) and applying restrictions. This is not to be mistaken with the materialization of objects.

That is not completely true - let me be a bit of a troll - imagine for example that you keep an ordered list of orders, using this implementation you could simply do a direct access to the first or last item of the list (depending on how you were ordering it).
Well, introduce me to the persistence framework that does that and I'll take a byte at it. Still, you are still materializing all these objects into memory (because the framework now has the burden of sorting them) to use just one. Even if the sorting is delegated upon the DB engine, you would still materialize an whole set of proxies (at best) to use only just one. Multiply that with your entire result set and there you have it...

Anyway, allow me to provide with yet another example… Say you have a class with a state machine. This class has states s1, .., sn. Now you wish to provide a way for the user to search through your 1e7 records with a criteria that maps to a set of check boxes representing each state. Selecting none searches objects with any state. Selecting some represents the union of states selected.

You can simply add an index on the state, and using the IN operand you get some pretty quick results (the engine is quick to discard unselected states...). Would doing that in memory be anywhere near that efficient?.

And yet another question: say you wish to do paging on the results… Using a parametrized query on the view can quickly discard unwanted results… Doing that in memory can be disgraceful, even only materializing a list of, say, 1000 proxies to use only 20.

My point being, the sum of inefficiencies DDD presents in this field can very well be the deciding factor not to use it in a performance critical environment…

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 4 Guests.
This is a modified version of snipsnap.org created by >>Paulo Abrantes