On Mon, 2006-03-06 at 15:06, Sean Gilligan wrote: > Allen Gilliland wrote: > > My initial opinion is still "mixed bag", but I am definitely willing to > > hear more about how you would want to integrate Spring. I still haven't > > really done much with Spring, but I do see some ways in which it could > > be useful to Roller. > Allen, I definitely recommend that you at least spend a couple of hours > looking at Spring for distributed transactions and pluggable ORM layers > before going ahead with your proposed refactoring of the transaction code. > > I'm far from a guru on this subject, but am in alpha testing on an app > that using Spring+Hibernate, so I'm willing to answer any questions to > the best of my ability.
I will certainly do that, but this may be the realm where I would be least likely to start using a framework like Spring. My main concern is that we would move away from our own implementation of Hibernate and into a version of Spring Hibernate, doing Hibernate the way Spring suggests. This stems from a belief that frameworks are good at making things easier for people who don't want to dig into the details, but they aren't particularly as good when someone wants full control over what's happening. This is very common in engineering of all sorts, the inverse relationship between simplicity or ease of use and control/performance. Sure there is always middle ground, but in most cases you must give up control in order get simplicity and I'm not always convinced that is a trade off I want to make. > > > > > One question I have is are there any controls on what beans someone can > > access via Spring? i.e. if I use appfuse as an example I noticed that > > there is a bean defined for the Hibernate sessionFactory. is there > > anything that prevents someone in the presentation layer from trying > > ctx.getBean("sessionFactory")? that is one thing that I wasn't sure > > about. > > I think Anil has answered this question fairly well, but I believe there > is another option. If you really wanted to keep certain beans > restricted to a particular layer or module, that module could have a > private BeanFactory that the other components are not aware of. In > other words they won't be able to get access to the "ctx" > variable/reference. (In my opinion, this shouldn't be necessary.) Hmm. That sounds promising to me. I'd like to hear more about that. > > > > > This is the other big thing that I am concerned about with Spring in > > Roller. I really don't want go back to making the config more > > complicated and spread out. > This is a valid concern and one that Spring doesn't automatically > address. And there is an inherent trade-off in making components more > modular vs. keeping configuration simple and in one place. Anil (and > the team) should address these issues in any proposal(s). I think at this point I am also just having a bit of fun giving you guys a hard time about your attempts to get Spring into Roller ;) -- Allen > > -- Sean