Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: "Reference Implementation" for Spring?

  1. #1
    Join Date
    Feb 2006
    Posts
    164

    Default "Reference Implementation" for Spring?

    Hi, everyone.

    Is there a "reference implementation" for Spring?

    By that I mean something essentially similar to this:

    http://java.sun.com/j2ee/tutorial/1_...Overview6.html

    Reason I ask is that so far, I have purchased and read through 3 Spring books, and tried the associated source code examples, but none of them fully show how to use Spring to easily switch from testing business outside the J2EE container to inside it, and to me, that seems like one of the essential promises of the Spring framework, yes?

    For example, see my thread under EJB forum: "JBoss EJB spec violation in AbstractStatelessSessionBean?"

    For another example, the JNDI lookup code in the servlet example in "Pro Spring" chapter 13 (see thread I mention above) works fine for me inside the JBoss J2EE container (once I fixed the obvious bugs in the book's code sample), but after many hours of tinkering with various JNDI servers from JBoss and Simple JNDI, due to various classpath/security problems with JBoss JNDI server and incompatibilities between Spring ApplicationContext and Simple JNDI (http://www.osjava.org/simple-jndi/), I have been unable to get the Spring framework to successfully call the JNDI lookup logic both in and out of the J2EE container. (I can, however, get SimpleJNDI lookup to work ok, if I do NOT use the Spring framework, i.e. the problem appears to be an incompatibility between Spring and SimpleJNDI).

    In the current Spring books and on this forum, I keep reading how easy it is to use the Spring framework to test in and out of the J2EE container, but I'm not finding that to be the case so far, and I start to wonder if "Crazy Bob" and his followers might not be so crazy after all:

    http://crazybob.org/2006/01/i-dont-get-spring.html

    Over many years, as a business app developer, I've been promised a lot by tool makers who have claimed to have tools which will make me more productive:

    Pascal was going to be a better language than Basic and Fortran.

    4thGL languages were going to be better than COBOL, and would eliminate the need for most programmers.

    Object-Oriented databases were going to be better than relational databases.

    EJB 1.x was going to be the greatest thing since AppleSoft.

    EJB 2.x was going to be even better...

    EJB 3.x is going to be even better...

    Some tools actually HAVE made me more productive: VisiCalc, TCP/IP sockets, relational databases, COBOL, SQL, Visio, email, the web, google, VB, OO, WSAD/Eclipse, JBoss/Eclipse, and so on, but so many tools have not fulfilled their promise that I'm naturally skeptical at first, of any new tool such as Spring.

    That being said, I do see good promise in the Spring framework. A full reference implementation in, say, JBoss/Eclipse or MyEclipse, or any reasonably usable IDE for that matter, one that FULLY implements the essential promises of Spring and DI/IoC (the stuff on this forum and/or the Spring book forums that is both popular and problematic for the average business app developer), would eliminate much of the difficult learning curve, and would give me, and perhaps other who are relatively new to Spring, more confidence in recommending it for industrial-strength production use.

    Does such a "reference implementation" exist, or if not, could you add it to springframework.org for us?

    Ben

  2. #2
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    You mean other than the "samples" in the distribution? Like JPetstore Spring based implementation?

  3. #3
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    Since Spring is not a specification like J2EE or Java, there is only one implementation. Well, actually there is two. One for Java, one for .NET. But only one for each language.

    As for Spring helping you test your business objects outside the container: I think it does a good job with this. How it does that is it encourages you to write you business objects separate from your infrastructure, as descirbed in that Pro Spring article you quoted. Testing your objects not only don't need a container. They also don't need Spring. Spring then gives you capabilities to place your buiness objects back into your infrastructure. It does this by provoding hooks into J2EE container services for writing DAOs, EJBs, MDBs and web applications.

    For DAOs and web controllers, Spring makes it easy to test these out of the container. I don't feel its designed to test actual EJB/MDB outside the container. That is what testing frameworks like MockEJB is for.

    Spring has provided a great amount of value to me. The biggest value was teaching me to write my business objects without tying myself to not only to EJB, but to Spring itself. In fact that is why Crazy Bob doesn't "get" Spring. He knows how to write his applications outside the container, and doesn't see why he needs Spring to help him put it back in.
    Bill

  4. #4
    Join Date
    Dec 2005
    Location
    U-241
    Posts
    237

    Default

    Hi Ben,

    The way I see, there is an attempt to create such a reference implementation for Spring+WebLogic

    http://dev2dev.bea.com/pub/a/2005/09...ic_server.html .
    http://commerce.bea.com/showproduct....=1.2.5&minor=0

    http://forum.springframework.org/showthread.php?t=22033

    Cheers,
    Arno
    Spring, it's a wonderful thing...

  5. #5
    Join Date
    Feb 2006
    Posts
    164

    Default

    Quote Originally Posted by jbetancourt
    You mean other than the "samples" in the distribution? Like JPetstore Spring based implementation?
    Assuming it demonstrates the major features of Spring, including showing how to use Spring to easily switch from testing business logic outside the J2EE container to inside it, yes, I think JPetstore would do nicely. Does it do that now? If so, can you please point me to it?

    Although I personally could probably get by without it, it would be extremely helpful (meaning it would significantly shorten the "tinker-time") if it contained accompanying documentation sufficient for a reasonably competent J2EE business app programmer to get it up and running in some "reference IDE" (MyEclipse, JBoss/Eclipse, NetBeans - take your pick) without too much pain . This could perhaps be modeled along the lines of what, say, MyEclipse offers here:

    http://www.myeclipseide.com/ContentE...y-ceid-16.html

    ...and what Sebastiaan Hennebrueder offers at Laliluna here, for example:

    http://www.laliluna.de/first-steps-s...-tutorial.html

    I did the above tutorial using MyEclipse a while back, and it flowed well. I'm currently using JBoss/Eclipse IDE which is also quite good.

    Again, if JPetstore Spring demo clearly shows how to quickly/easily test its main business logic in and out of the J2EE container using ApplicationContext.xml and DI/IoC, please just point me to it.

    Ben

  6. #6
    Join Date
    Jul 2005
    Posts
    246

    Default

    Quote Originally Posted by benethridge
    Assuming it demonstrates the major features of Spring, including showing how to use Spring to easily switch from testing business logic outside the J2EE container to inside it, yes, I think JPetstore would do nicely. Does it do that now? If so, can you please point me to it?
    It's in the distribution that you've already downloaded in the "samples" directory...

    Bob

  7. #7
    Join Date
    Jul 2005
    Posts
    246

    Default

    Quote Originally Posted by benethridge
    Hi, everyone.

    Is there a "reference implementation" for Spring?

    By that I mean something essentially similar to this:

    http://java.sun.com/j2ee/tutorial/1_...Overview6.html

    Reason I ask is that so far, I have purchased and read through 3 Spring books, and tried the associated source code examples, but none of them fully show how to use Spring to easily switch from testing business outside the J2EE container to inside it, and to me, that seems like one of the essential promises of the Spring framework, yes?

    For example, see my thread under EJB forum: "JBoss EJB spec violation in AbstractStatelessSessionBean?"

    For another example, the JNDI lookup code in the servlet example in "Pro Spring" chapter 13 (see thread I mention above) works fine for me inside the JBoss J2EE container (once I fixed the obvious bugs in the book's code sample), but after many hours of tinkering with various JNDI servers from JBoss and Simple JNDI, due to various classpath/security problems with JBoss JNDI server and incompatibilities between Spring ApplicationContext and Simple JNDI (http://www.osjava.org/simple-jndi/), I have been unable to get the Spring framework to successfully call the JNDI lookup logic both in and out of the J2EE container. (I can, however, get SimpleJNDI lookup to work ok, if I do NOT use the Spring framework, i.e. the problem appears to be an incompatibility between Spring and SimpleJNDI).

    In the current Spring books and on this forum, I keep reading how easy it is to use the Spring framework to test in and out of the J2EE container, but I'm not finding that to be the case so far, and I start to wonder if "Crazy Bob" and his followers might not be so crazy after all:

    http://crazybob.org/2006/01/i-dont-get-spring.html

    Over many years, as a business app developer, I've been promised a lot by tool makers who have claimed to have tools which will make me more productive:

    Pascal was going to be a better language than Basic and Fortran.

    4thGL languages were going to be better than COBOL, and would eliminate the need for most programmers.

    Object-Oriented databases were going to be better than relational databases.

    EJB 1.x was going to be the greatest thing since AppleSoft.

    EJB 2.x was going to be even better...

    EJB 3.x is going to be even better...

    Some tools actually HAVE made me more productive: VisiCalc, TCP/IP sockets, relational databases, COBOL, SQL, Visio, email, the web, google, VB, OO, WSAD/Eclipse, JBoss/Eclipse, and so on, but so many tools have not fulfilled their promise that I'm naturally skeptical at first, of any new tool such as Spring.
    Spring is a framework, not a tool. In the same way as Struts, Hibernate etc etc.

    Quote Originally Posted by benethridge
    That being said, I do see good promise in the Spring framework. A full reference implementation in, say, JBoss/Eclipse or MyEclipse, or any reasonably usable IDE for that matter
    Nooooooo!!!!!! Example applications should NEVER be IDE dependent.

    Quote Originally Posted by benethridge
    , one that FULLY implements the essential promises of Spring and DI/IoC (the stuff on this forum and/or the Spring book forums that is both popular and problematic for the average business app developer), would eliminate much of the difficult learning curve, and would give me, and perhaps other who are relatively new to Spring, more confidence in recommending it for industrial-strength production use.

    Does such a "reference implementation" exist, or if not, could you add it to springframework.org for us?

    Ben
    Just do what I did (and I'm sure many others). When your next project comes up, just use Spring instead of EJB or whatever you've been using up to now. You will never learn enough about a framework from reading books, following examples, going on training courses etc etc, to know whether to use it or not. You can only get that experience by actually using it.

    OK, it may take you a bit longer to get the project done as you're using a new framework, but it's the only way IMO.

    You need to stop thinking like a manager and behave more like a devloper ;-)

    Bob

  8. #8
    Join Date
    Feb 2006
    Posts
    164

    Default

    Quote Originally Posted by Cowboy Bob
    Spring is a framework, not a tool. In the same way as Struts, Hibernate etc etc.Bob
    That's just semantics. Tools and frameworks are both software that (usually) someone else wrote, which help me design, develop, test and deploy my business logic.

    Quote Originally Posted by Cowboy Bob
    Nooooooo!!!!!! Example applications should NEVER be IDE dependent.
    I think you may be missing my point, and I don't see why you need to shout at me until you at least understand what I'm saying:

    I don't want it to be "IDE dependent". I just want the Spring team to FULLY implement a sample app that FULLY shows off the essential promises of Spring. That would include what I'm calling a "Reference IDE". Good developers can easily do the conceptual and syntactical "mapping" to their own IDE flavor, once they see how it's done in the "reference IDE"...ANY reasonable reference IDE.

    So far, I can't see that the Spring team has done this. When look through the JPetstore sample for instance, I can only find one (apparently minor) Junit test, OwnersTest.java. I expected to see dozens, showing off Spring's ability to easily switch from testing my business logic outside the J2EE container (or the servlet container) to inside it. Maybe they're doing in some other way that I'm not seeing, and if so, please just point it out to me, as I hope I'm just missing something simple here.

    However, if you or someone else in this forum can't point it out, then I think that my essential question is still unanswered:

    Can Spring enable me to easily switch from testing my business logic outside the J2EE container (or the servlet container) to inside it? If so, please show me exactly how to do that end-to-end in some kind of "Reference Implementation", or in some other reasonable way that the average J2EE business app developer can understand and implement.

    In software development, and in life, I've often found that the unanswered question is the most important question to pursue....Maybe that's how I got to be a manager ;-)...and that no answer is, in itself, often a kind of answer.

    Ben

  9. #9
    Join Date
    Jul 2005
    Posts
    246

    Default

    Dilbert wouldn't be so funny if it wasn't oh so true...

  10. #10
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    I certainly think a tutorial like the one you are talking about would be greatly useful for showing off Spring's capabilities. Sounds like a good premise for a hands on book.

    But unfortunately, as far as I know, there doesn't exist such a tutorial. The subject is probably covered in one form or another spread across books and forums and samples. But nothing you can plop a developer down in front of and give them a soup to nuts introduction.

    I think this is because its a lot of work. Examples, reference guides and javadoc are minimums expected on top of the regular framework where you have to fix bugs, implement new features and write unit tests. I've found this to be true of even commercial software vendors.

    I think another reason is because teaching people about these technologies is what companies like Interface21 do for a living. I'm not trying to imply some evil intent. But at some point all of the software, forum postings and other work these people do has to yield a paycheck. The key is finding a balance. Between free examples, reference docs, etc. and commercial books, consulting and training classes. I think compared to other open source projects Spring does a decent job.

    I'm not saying the current state of things can't be improved. I've seen experienced J2EE developers have a tough time "getting" Spring, even when they buy the books, look at the examples and try to work with it. A comprehensive hands on tutorial like you describe would alleviate some of that. I just don't think, with all that is planned for Spring, that will be a very high priority.
    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •