GeeCON Prague 2014*
The moose likes Struts and the fly likes Spring Live Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Spring Live" Watch "Spring Live" New topic
Author

Spring Live

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hello Matt,

Welcome to Javaranch

1. Could you please tell me when should be used in an application ?
2. What is the future of Spring?
3. What is Spring's MVC framework ?
4. Why is the book titled "Spring Live"?

Thanks


Groovy
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
What is Spring's MVC framework ?


Spring's MVC implementation is not just any implementation, it provides a clean separation between domain model code and web forms and allows you to use all the other features of the Spring Framework like validation


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312

Spring Live is designed to explain how to integrate Spring into your projects to make your development life easier. It is aimed at users that are familiar with Java development, but have never used Spring. As you read this title, you will learn how Spring reduces the amount of code you have to write and why it's getting so much attention (and respect) from the Java community.


Spring Live
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
You can also go through new book from Rod Johnson: " Expert J2EE one-on-one without EJB".

It has lot of preaching about merits of Spring and its relative advantages over EJB concept etc.


Kishore
SCJP, blog
Mary Wallace
Ranch Hand

Joined: Aug 25, 2003
Posts: 138
You will get the all information in this web page
Jeff Duska
Greenhorn

Joined: May 14, 2003
Posts: 8
I'm jump in here and give you my two cents worth. I've been using Spring for about almost six months in production solution.

Originally posted by Pradeep Bhat:
Hello Matt,

Welcome to Javaranch

1. Could you please tell me when should be used in an application ?


I really like using in my the Data Access Layer. Here is why. First, I gain ton of flexibility. Since my business object are no longer coupled to the database routines or libraries, I can switch between JDBC, Hibernate, iBatis with ease.

My system can use both a JDNI lookup or DriverManager. To change between these, I update an XML file, known as the Application Context. This great for TDD, because you don't want have do all the JNDI start just to run your unit tests.

I recent found that all my queries need to be wrapped in a transaction, because Oracle Gateway wouldn't work correctly. Typically, you'd have find all the query methods set the autocommit property to false and add a commit. Thanks to Spring, I didn't have to touch one line of code! I just used Spring AOP based transaction support to wrap all my DAO objects in a transaction. It took longer to read about it than it did to write the updated XML file. Pretty slick stuff.


2. What is the future of Spring?


I think it is pretty bright, since J2EE 3.0 spec is looking at this stuff a lot. Since it doesn't lock you into a database framework, or MVC framework, you gain a lot of flexbility without a lot of work. I'm using JDBC for my data access objects, because I still not sold on Hibernate for my project. The cool thing is that I can change my mind, since JDBC dependices are handled by Spring... I can change this really quite easily.


3. What is Spring's MVC framework ?


Rod and the Spring folks don't feel that any of the current MVC frameworks are good-enough. They support all the key frameworks like Struts, WebWorx, Tapstrey and such. This mean you can keep your framework, if you like it. But they think that they have taken the best features of each to create Spring MVC. This is one area, I'm still not sure I sold on. I see some of the flexibility, but think that Struts juggernaut too much to fight.



4. Why is the book titled "Spring Live"?


I'll leave this one to Matt.


Checkout my Java Blog at <a href="http://java.duska.com" target="_blank" rel="nofollow">http://java.duska.com </a>
john Lin
Greenhorn

Joined: Dec 03, 2002
Posts: 8
I would like to know how many people in this forum are currently using Spring in development/production ? and for how long?

Where can I find the survey data of Spring usage?
vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 395
Our project is using spring and hibernate.


vasu


What a wonderful world!
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114

4. Why is the book titled "Spring Live"?


Because unlike traditional books, SourceBeat books are "live". Rather than buying a book, you buy a subscription and not only do you get a 1.0 version of the book, but you get monthly updates for a full year.

Read more at sourcebeat.com


Matt<br /> <br />Author: <a href="http://springlive.com" target="_blank" rel="nofollow">Spring Live</a> and <a href="http://www.apress.com/book/bookDisplay.html?bID=256" target="_blank" rel="nofollow">Pro JSP</a><br />Weblogs: <a href="http://raibledesigns.com" target="_blank" rel="nofollow">Raible Designs</a> <a href="http://jroller.com/page/raible" target="_blank" rel="nofollow">Spring Live Blog</a>
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Matt Raible:


Rather than buying a book, you buy a subscription and not only do you get a 1.0 version of the book, but you get monthly updates for a full year.



Hi Matt,

For now what version of Spring does the book cover?
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
I just updated it to cover Spring 1.1.1 last week. When Spring 1.2 comes out, I'll update it for 1.2. That's the beauty of the subscription model - the book will always be up-to-date with the latest version.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Jeff Duska:
I think it is pretty bright, since J2EE 3.0 spec is looking at this stuff a lot.


Jeff what do you mean by the above?

./pope


blog - InfoQ.com
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by john Lin:
I would like to know how many people in this forum are currently using Spring in development/production ? and for how long?


+1. One of my ideas to use IoC is published here:
Independent IoC-ish unit testing.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Matt are you involved also in the development of Spring? (otherwise I think it would be very hard to catch up with the guys... they are moving fast ).

./pope
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
Originally posted by Ali Pope:
Matt are you involved also in the development of Spring? (otherwise I think it would be very hard to catch up with the guys... they are moving fast ).


No, I am not a Spring Committer. To keep up with development of Spring, I subscribe to their mailing list and try to stay active on their forums.

The other thing that keeps me up-to-date is AppFuse. I develop AppFuse in my spare time and use it in my day job - so I'm constantly learning how to do things better and faster with Spring. It's kinda interesting to switch from being a Spring teacher one day to being a Spring user the next - keeps me on my toes!
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
I know how it makes you feel . Appreciate very much your solutions to web frameworks.

./pope
Jeff Duska
Greenhorn

Joined: May 14, 2003
Posts: 8
Originally posted by Ali Pope:


Jeff what do you mean by the above?

./pope


I should have attributed the quote to Bruce Tate. He was saying this a lot during the NFJS Spring talks this Spring. (No Pun intended) From what I've read, it basic pointing out that we can use POJOs for Session Beans and there some rumors that there might be IoC support added. I'm not sure if that is true. It suppose it depends on your point of view. It might be just be hopeful thinking. Sorry, I wasn't clearer.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Afaik the POJO discussion in EJB spec goes to replace entity beans and not session beans. Maybe they will try to provide a non-intrusive solution also for sb - but I cannot remember reading this.
Emman lopez
Ranch Hand

Joined: Mar 11, 2004
Posts: 38
Hi everyone,
question about Spring Live:
I would like to know how the book helps you in the learning curve of Spring framework. how hard is it to learn Spring?


E.L.<br /> <br />SCJP
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
Originally posted by Emman lopez:
Hi everyone,
question about Spring Live:
I would like to know how the book helps you in the learning curve of Spring framework. how hard is it to learn Spring?


I've written the book for readers that are familiar with Java and web frameworks, but know nothing about Spring. So hopefully it'll rapidly accelerate your Spring learning curve. It's backed full of example code and a sample app so you can take what you learn and use it in your projects right away.
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209


I would like to know how the book helps you in the learning curve of Spring framework. how hard is it to learn Spring?


The book URL says it all:

It is aimed at users that are familiar with Java development, but have never used Spring.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Originally posted by Matt Raible:


I've written the book for readers that are familiar with Java and web frameworks, but know nothing about Spring. So hopefully it'll rapidly accelerate your Spring learning curve. It's backed full of example code and a sample app so you can take what you learn and use it in your projects right away.


Matt should I read the above quote as you focus mostly on web solutions and web framework integration?

10x

./pope
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
J2EE applications tend to be mostly web-based, so yes, this is the primary focus of the book. However, the last 3 chapters (Peristence Strategies, Unit Testing and AOP) have had nothing to do with the web. The next chapter on Transactions is non-web, but the one after that is focused on integrating Spring with WebWork, Tapestry and JSF (Struts is already in 1.0).

The list of future chapters is listed on the wiki.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
I think my experience with J2EE doesn't follow the pattern. I am developing J2EE applications for a long time (since fall 2000) but most of them (I think except 3 or 4) haven't been web based (or at least the web part was much intended only for read-only access). I do not consider myself a sustainer of thin clients (Swing or more nowadays SWT), but till now they were better solutions (for us).

./pope
Thomas Whitmore
Ranch Hand

Joined: Aug 05, 2004
Posts: 33
Hi Matt, Pradeep, Ali,

Just been working with Spring recently and very impressed compared to J2EE/ app server configurations and glue coding.

Pradeep:
> What is the future of Spring?

I assume Spring will become more popular and even more powerful in the future, but if you have any idea how much easier it makes stuff you'd be getting stuck right in.

Just imagine if you could do enterprise apps by just coding what you want. As opposed to coding 4x lookups, catch clauses, casts, remotes for pretty much every single useful thing you code... Now go and install Spring.

Ali:
> Afaik the POJO discussion in EJB spec goes to replace entity beans and not
> session beans. Maybe they will try to provide a non-intrusive solution
> also for sb - but I cannot remember reading this.

We've been working with ResourceAdapter, JCA, DataSource and MBean configurable components. Developing server-portable configuration and then working with Spring just makes one's jaw drop at how wrong things can be.

We're putting JSPs/ Tiles together with a few service classes and JDO database integration, at the moment. The core of this app was running after a few hours; with completion projected at 6-8 working days. Classical J2EE would take so much longer, it's not funny.


Cheers,
Thomas Whitmore
www.powermapjdo.com
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Thomas thanks for sharing with us your experience with Spring.
My quote was refering to POJOs in EJB spec and not about POJOs in Spring .

./pope
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
I downloaded spring and started writing some code. ServerSide.com has some nice articles on Spring AOP btw.
Ok there are quite a few entries in my springconfig.xml
Is there a chance that soon it would start looking real cluttered?.
That leads to my next question.. what kind of entries do you guys actually make in the xml file. Do you guys get Sprint to manage all associations between objects through the XML file? I mean 'Dependency Injection' is fine.
But in practice are all dependencies between objects managed through Spring?
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
Originally posted by karthik Guru:
I downloaded spring and started writing some code. ServerSide.com has some nice articles on Spring AOP btw.
Ok there are quite a few entries in my springconfig.xml
Is there a chance that soon it would start looking real cluttered?.


This is a valid concern. I often break my layers up into different context XML files. That way, my data layer only has database-accessing beans. This makes it easier to organize things. Also, using a tool like XMLBuddy in Eclipse makes it easy to navigate w/ it's outline view. Of course, the Spring IDE is pretty nice too.


That leads to my next question.. what kind of entries do you guys actually make in the xml file. Do you guys get Sprint to manage all associations between objects through the XML file? I mean 'Dependency Injection' is fine.
But in practice are all dependencies between objects managed through Spring?


It depends on your project. Often times, dependency injection will result in the cleanest code (your classes don't know about each other at all). Your best bet is to dig in and try it and see what works for your application(s).
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
I think that Matt's suggestion is the only one that will keep (in a way) your configurations clean.

./pope
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Some authors suggest using Spring in current projects and moving to EJB 3.0 from Spring in the future. Why are they advocating migration ?
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Maybe because they didn't see the EJB3.0 spec yet or an implementation :-).

./pope
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Ok I thought Spring is much more than EJB3.0
I thought Spring would add support for EJB 3.0 when it is released.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by karthik Guru:
Ok I thought Spring is much more than EJB3.0
I thought Spring would add support for EJB 3.0 when it is released.

Spring is more than EJB 3.0. The EJB 3.0 spec doesn't say a word about MVC, for example.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Indeed Lasse. (as i already said) Spring is IoC/DI framework which provides a large spectrum a plugability (for web solutions, for AOP solutions, for accessing EJBs, for using JMS, etc.)

./pope
 
GeeCON Prague 2014
 
subject: Spring Live