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

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

Created by jpmsi. Last edited by jpmsi, one year and 210 days ago. Viewed 492 times. #3
[diff] [history] [edit] [rdf]
labels
attachments
As you know - since you've already been developing code at FenixEdu - a thin service layer can be present in DDD approaches offering transactional support. By thin layer I mean dumb services, in other words, services that are not aware of business logic - that will be taken care by the objects - and will only do gets and sets of objects.

Well, I was just mentioning the standard approach developers often use with SOA. In my current project, our project leader decided to use a ThreadTransactionManagar that is used in every entry-point on the service layer (I although I do not want to elaborate further, I ca still say I dislike that approach). Basically the transaction manager offers one transaction per thread, allowing us to use nested service calls :S.

But… now that you've mentioned aspects, that seems an interesting interesting approach! What's the main idea? Mark a setter as transactional?

When I mentioned Aspects, I was referring to the process of adapting an already framework to transparently use the transactional system. I have had some time with NHibernate now, so I can safely say it is not a good think when programming DDD. First, there is the need to create a Session context for each service (transactional unit), and that does not merge well with our DDD approach. After that, for each modification we have to call object.save() to persist changes. And to create/delete we have to call static methods on the Domain class. This is not a very good DDD way of doing things. My naïve Aspects comment was about calling save after each setter (which in the end does not offer a full solution)… Comments are more than welcome...

I did thought about some other approaches, namely only persisting changes on the persistence layer upon commiting, and walking the graph of objects to determine creations/updates/deletes. However this approach requires the use of an Software Transaction Memory manager, which is exactly what you guys use @ fénix.

Other idea - never tried it so I'll just hope this doesn't backfire on me - was to use >>lucene as your domain object indexer. With following "rules":

Regarding searches, I will add only this: you are still throwing away performance when you want to search across multiple tables (read joins).

Should anyone come up with a good solution, please do tell me… Although I pretty much doubt such would exist...

Edit: I found some good reading about the subject

And I would recommend reading some other posts that are off-topic for this discussion.
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 11 Guests.
This is a modified version of snipsnap.org created by >>Paulo Abrantes