Advanced State Management with JBoss Seam "Dependency Injection is like COBOL with Polymorphism" The main conference room is filled with over a hundred software professionals filling in for Gavin King's presentation "Introduction to Seam." Most of these delegates have a vested interest in the direction of the Java platform and are thrilled to get a glimpse of Gavin's latest contribution to the community. After working with Hibernate, and understanding the elegance of the EJB 3.0 specification, King is poised to amplify productivity by addressing many of the fundamental issues Java developers face worldwide. Seam is an application framework that naturally bridges the gap between EJB 3.0 and JSF and introduces several needed enhancements like managed conversations, advanced state management and business process management. Previously, developers had to rely on extremely fragile conventions to manage state across unpredictable browser navigation events. Actually, very few interesting websites accurately manage state and distinguish actual navigation events like the browser back, next and refresh buttons. To illustrate, imagine walking into a bookstore and hearing the cashier say, please don’t do anything unexpected during the next 45 seconds, or you might be charged twice? Why should the online and personal transactions differ so dramatically? Seam extends the interaction model to include business process management as a natural and straightforward aspect of the framework. The idea of bi-injection, or bi-directional injection of dependencies, is also very interesting and allows developers to cross validate behavior at runtime. Gavin described bi-injection as "COBOL with Polymorphism" to a round of cautaus laughter. Gavin’s personality and passion for simplifying the developer’s experience and streamlining specifications to the core is a rare talent in the software industry today. One can only hope his enthusiasm for advancing the Java community becomes contagious.
News: Advanced State Management with JBoss Seam
Ray Hindman, writing from TSSJS Barcelona, has written up Gavin King's presentation on Advanced State Management with JBoss Seam, and represents Gavin as saying "Dependency Injection is like COBOL with Polymorphism." I'm not sure I like the comparison of DI to Object COBOL. :) Here's his writeup:
- Posted by: Joseph Ottinger
- Posted on: June 22 2006 11:59 EDT
- Gavin's loosing focus by Vinicius Carvalho on June 22 2006 21:50 EDT
- Re: Advanced State Management with JBoss Seam by Radu-Adrian Popescu on June 23 2006 01:08 EDT
- Well, it just works by Paolo Guccione on June 23 2006 05:36 EDT
- Seam is a good idea - attacking DI is not by Joseph Mays on June 23 2006 10:48 EDT
- Gavin: Question about transaction management Seam by peter veentjer on June 26 2006 05:06 EDT
- Extra: is same session used? by peter veentjer on June 26 2006 05:38 EDT
- Re: Gavin: Question about transaction management Seam by Gavin King on June 28 2006 10:36 EDT
Hello there! I've been in the last 2 Rio Java Summit where I had the great chance to be at a Gavin's presentation and speak with him. Last year he was talking about EJB 3.0 persistence model, and also about how developers where not happy about the way the things were going on development. I really was very pleased with his presentation. This year, well... I really think that Seam is a good framework, it does solve many problems, but attacking DI? Well, isn't the way EntityManager is injected a DI approach? I guess this is all because his little battle against Spring folks. Gavin's deserve all respect and atention, but I think his loosing focus here, attacking other great developers and their ideas. That's just my opinion from what I've seen in his last presentation as well as recent posts and news around the net. just my 2 cents
This year, well... I really think that Seam is a good framework, it does solve many problems, but attacking DI?In the context of my talk, you'll understand that what I'm questioning is so-called "stateless" architectures (so-called, because they are rarely truly stateless in practice, they merely do ad hoc, fragile state management). If you have an architecture composed completely of stateless components, you probably don't have real objects anywhere (state+behavior, remember). You are probably pulling and pushing the state that really belongs in your objects from the HttpSession and into your objects on every request. So what DI gives you is essentially equivalent to the ability to plug function pointers together (hence "COBOL with polymorphism). I'm not trying to attack any particular group or project, instead, I'm making a substantive point about almost all current Java architectures (which are usually based on either SLSBs, or Spring), in what I hope is an entertaining way. Apparently I'm successfully keeping you guys entertained ;-) And, of course, I'm proposing a constructive alternative: stateful, contextual components with -bijection-. You can think of bijection as "dependency injection 2.0" if you like. Don't try to understand what I mean by reading out-of-context quotes on TSS. Instead, go and look at the Seam examples, and read the documentation :-) And guess what guys: if it's OK for all the EJB haters to throw FUD and hate at EJB3 at every opportunity, its OK for us EJB3 lovers to turn round and point out where the proposed alternative architectures have their own flaws and limitations. That's fair, surely?
Don't try to understand what I mean by reading out-of-context quotes on TSS. Instead, go and look at the Seam examples, and read the documentation :-)Point taken. I have looked at the Seam docs, and I've downloaded it and played with the examples. I think there are a lot of really great ideas in it, and I'm prototyping some really interesting stuff with it.
And guess what guys: if it's OK for all the EJB haters to throw FUD and hate at EJB3 at every opportunity, its OK for us EJB3 lovers to turn round and point out where the proposed alternative architectures have their own flaws and limitations. That's fair, surely?That's not okay either. I'm also tired of hearing how terrible EJB 2.1 is and how the only good thing about EJB3 is JPA. Whatever. I've used EJB 2.1 successfully (well, okay, not entity beans), and I really like EJB3, including the session beans.
I think that pointing out differences between technologies is good, I just *wish* it could be done with a little more respect. I mean, come on, we've seen really great ideas coming from JBoss, Google, Spring... Let's discuss and compare these without trashing one another.
Apparently I'm successfully keeping you guys entertained ;-)Yes, Gavin, you're always entertaining :-)
Is it me or the quoted article really sounds like "wow gavin is sooo smart and beautiful and talented and what a wonderful personality I think I want to f*ck him" ?! OMG ponies!!!
IMO, Gavin King is not attacking dependency injection. In fact, he is almost suggesting it is a "silver bullet"". And I agree that Object COBOL is not necessarily a positive example of software evolution. Anyway, I am currently using Seam for a real project (yes, one with schedules), so I can dare to offer a 3c advice instead of the usual 2c. The framework does work, in spite of some bugs still hanging about here and there, and it is definitely useful to create complex web applications with reduced time and effort. Just a warning for those who want to try it: there are some issues that are given as hints in the release notes, but are in fact mandatory in my experience. First of all, you must have JBoss EJB 3.0 RC8 installed as a separate plugin. With a plain 4.0.4 GA, I was unable to have the framework behave correctly. Second, you must use the component.xml file to configure components, not property setting. Once you get around these small nuisances, the beneficial effects are rather similar to those advertised. Which is far less common than it should be in the IT industry....
I think the reference to DI is yet-another-jibe-from-jboss-against-spring. Gavin has made some great contributions to the community, but his attitude towards the spring commutters really stinks. Sure, in Spring1.x there wasn't a huge amount of innovation, companies like ATG had been pushing IoC for a long time before it arrived, but Spring 2.0 *is* really that good. Its a real shame that the two biggest contributors to the community (Jboss and Spring IMO) can't get on, worse still is that the animosity seems to be unidirectional, Rod and co. don't seem to go out of their way to attack jboss at every opportunity. Anyway, at least they are both making our lives as developers easier and we can only thank them for that ;)
This is really getting old. Why can't these guys just focus on discussing the merits of their technologies without putting others down? I mean, constructive comparisons are good for the community, but saying stuff like "Dependency Injection is like COBOL with Polymorphism" is just inflamitory. Gavin's smart, so we pay him attention, but does he have to be such a total a**?
Question for Gavin: I have been looking at the transaction management in Seam and I have a question. Seam uses two transactions: 1) the business logic 2) retrieving data for the view If you use two transaction and don't add any 'offline' concurrency control, the system could be subject to all kinds of isolation issues. If you add optimistic locking (very easy with hibernate) the system is not subject to lost updates, but it still is subject to isolation issues like phantom reads (it could happen that a different transaction has add a new item while you are between transaction 1 and 2. What are your thoughts behind these issues? Do you think it is an issue at all?
Is the same session used in transaction 1 and transaction 2? If a different session is used, you are also subject to non repeatable reads.
Question for Gavin:As long as you are using the second transaction only for _display_ of data, there are no transaction isolation issues. The actual "transaction" is over - now you are just displaying the current state of the universe (including the results of the transaction) to the user. :-)
I have been looking at the transaction management in Seam and I have a question.
Seam uses two transactions:
1) the business logic
2) retrieving data for the view
If you use two transaction and don't add any 'offline' concurrency control, the system could be subject to all kinds of isolation issues.
If you add optimistic locking (very easy with hibernate) the system is not subject to lost updates, but it still is subject to isolation issues like phantom reads (it could happen that a different transaction has add a new item while you are between transaction 1 and 2.
What are your thoughts behind these issues? Do you think it is an issue at all?