Yesterday, while searching for a good blogger.com client, I tried at least five different ones - all of them ranges from crap, which works, but only sometimes, to an utter uber crap, which looks like it was created by a madman.
Compared to a clients for a LiveJournal, where I have my Russian language blog, blogger clients are nothing. I wonder - why nobody created any good ones?
Couple of the months ago an architect from offshore development team suggested a new (to me at least!) way of handling nested SQL transactions in J2EE applications: create connection in Stateless Session bean and pass it to all DAO code. Being an J2EE architect myself I rejected that approach mainly due to the fact that I don't like to keep connection open for a long time in J2EE apps - it's reduces concurrency and it's a bad thing to do in general. I also have told offshore guys that J2EE App server is going to handle transactions a proper way.
Today I decided to look into JBoss source code to find out how transaction management is done inside. At first I have looked into transaction management itself. The code there is very simple: if, for example, commit is required to be executed - execute commit on all resources and collect results. But to which resources commit can be executed? Connection, probably... So I started looking for a methods and classes responsible to create and manage connections. And this is what I found in JBossManagedConnectionPool.java:
public ConnectionListener getConnection(Transaction transaction, Subject subject, ConnectionRequestInfo cri) throws ResourceException { // Determine the pool key for this request boolean separateNoTx = false; if (noTxSeparatePools) separateNoTx = clf.isTransactional(); Object key = getKey(subject, cri, separateNoTx); InternalManagedConnectionPool mcp = getPool(key, subject, cri);// Are we doing track by connection? TransactionLocal trackByTx = null; if (transaction != null) trackByTx = (TransactionLocal) trackByTxPools.get(key); // Do we have a previous connection in this transaction? if (trackByTx != null) { ConnectionListener cl = (ConnectionListener) trackByTx.get(transaction); if (cl != null) { if (traceEnabled) dump("Getting connection tracked by transaction " + cl); return cl; } }.....
}
That piece of code answers my question: if code requests a new Connection object while inside transaction - it will be given the same connection as to the other objects inside that transaction. There is no need to pass the same connection object to all nested DAO methods, it's done automatically by JBoss.
Now I know that for sure!
...is Kevin Gibbs. He announced a latest Google addition in the Google Blog Live. Now this giy from SlashDot can send him a cash donation.
That one I like! It gives people real freedom and flexibility. Price is right too. I think I'll download 30 day evaluation when time permits.
Now back to thinking about making a right choice between Hibernate and BMP EJBs...
Good and very thorough article about CMP Beans optimizations.
One question still makes me nervous: If its so hard to do that dance - why bother with CMP?
Moreover most of the "optimizations" are good for any database operations, not only for CMP beans. For example:
Make sure your finder methods use indexes
Huh?
Listened to a Webinar at Jboss.org about EJB3. What a nice piece of technology! Basically everything will be defined in attributes: @Session is for session beans, @Entity is for entity beans. It's like having metadata injected into actual classes - nice, very nice idea!
Though I must say that it's picked from .Net, but who cares?
Tomorrow I will look closer to Hibernate and entity EJB inmplementation in JBoss Application Server. I need to have a knowledge which way is best:
Also need to spend some time analysing Cocoon2/Struts 1.1 integration.
After third example based on non-functioning code I dropped reading "Software Architecture in Practice". I can provide more practice that authors of that book provided. There is no point continue reading that book if I have other software architecture books to read.
Tomorrow would be a big day for work project - management does big software architecture presentation.
We finally selected J2EE as platform choice. This is because all the infrastructure needed for out flexible project is available on Java side. We need to use xslt templates so our html pages would be really flexible - Cocoon2 is for that. We need a flexible way to manage our business logic - Struts is for that. And we need to scale our code up in future with no rewriting - J2EE for that.
I always inclined for MS solutions, but here is the perfect example why have chosen J2EE over .Net. Flexibility of solution and less license costs are the major players here.
Now I need to put more J2EE specific methods into my model. I wonder how Enterprise Architect would be able to switch my classes to Java and database to MySQL.
Well, one more day reading book, I think I have to go straight to third "real life" architecture sample because second one was about another unreleased project. Now it's about Air Traffic Control project, which was funded by FAA, but never was implemented "because of budgeting issues". In real world that means "project was well over budget even before implementation started". Which, in turn, speaks against architecture, because architecture supposed to help projects to be on budget...
Yesterday I subscribed on Channel9 Forums RSS and somebody wrote there that Visual Studio 2005 designer does not support UML. "Huh?", - I thought and went looking for more information. Read three or four articles and found that MS decided not to extend UML 2.0 with their extension, but to create whole new diagram language. Nice turn for Microsoft, wrong for developers. As far as I can see, MS research recognised that most developers use only class diagrams and never use any of the other UML artifacts and developers seldom use Visio, which Microsoft recognizes as full blown UML editor. That's fine, but what about architects? Should they use only class diagrams, which is by definition static views, to describe systems? There is no answer.
I use Enterprise Architect for my work. It is way better than Visio, much better than Rational XDE and would continue to stay better, than rudimentary Visual Studio 2005 tools. And it supports UML 2.0 and extensions. And there is a add-on for Visual Studio, though I haven't tried it.
Back to work...
One of our developers already asked me about buying it, but I can not justify that because company goes to outsourcing path and we will be doing only architectures, but no development.
Continued reading "Software Architecture in Practice, Second Edition". Read first "hand on" example of applied architecture is about software system for fighter jet, A-7E. Described system is really good for non object oriented assembly language it suppose to run. Decomposition is good, paradigms are working. Fine system!
But it just never worked! Authors claims that it was a primarily research goal for a system , not something for real production because the system was produced by US Naval Research Laboratory. As if US Navy has US Naval Software Production Laboratory of any kind. And if US Navy doesn't have any other software production facility and if project was never applied to a real fighter jet it is failure. We live in real world, we need real world working examples of architecture in place.
Anyway, will continue reading though really wanted to stop.
Started reading "Software Architecture in Practice, Second Edition". It looks like a good book, though first 20 pages have too much of "we mention it here, but for details refer to Chapter X". Which breaks logic a bit.
At work got through two meetings so far:
Removed all "new media"(wtf is that, anyway?) and added knowledge of RUP and UML as mandatory attributes. Is it a part of the job of Technical Architect to create a job specs for managers?
We are oficially late now. Not because of our bad work, but because of a low priority our requirements gathering work has in the eyes of our client. And we lost BA down the road. Account manager wants to know why we don't need a full blown Content Management System in this project. Well, that's the question: why do we need it if everything visible will be generated from database? Now I have date of my first deliverable: I need to deliver first version of Software Architecture documentation next Wednesday. I pretty confident that I will be able to finish most of that document, so no worries here.