• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advantage of using Spring Framework

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello everybody,

I am new to spring framework. Can anybody tell me what is the advantage of using Spring framework.
 
Ranch Hand
Posts: 479
1
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this.

Cheers,
Raj.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I have one question about this comparison thats not answered by the suggested link.Or may be I wasn't smart enough to figure it out.
In a traditional session facade architecture, I used EJB 2.0 (Session Beans) that can participate in a distributed transaction.
This is obvious because EJB 2.0 have a remote interface so one can make call across the network.

I read this article that says POJO facade is no good for distributed transaction.
My question : If we use spring, will it allow a POJO facade to support distributed transaction ? If not, then isn't that a disadvantage of using spring over EJB?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by aditee sharma:
If not, then isn't that a disadvantage of using spring over EJB?



I don't know if Spring does this or not. But if it doesn't then yes, I would say that is a disadvantage if your requirement is distributed transaction. Otherwise, the point is moot. What exactly is your requirement?
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


What exactly is your requirement?


No requirement as such. I am just trying to understand and increase my knowledge.
Can we use Spring with POJO's for distributed transactions or not?
In particular, I want to know that is it really that a POJO facade can never be used in a distributed transaction, or can we do it with Spring or any other framework.

One more point: A transaction may not be distributed even though the environment is distributed. Correct?
So, is Spring good for a distributed environment? (eg. for failover).
Have a nice long weekend!.
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To help you understand my question better:
I have a mostly EJB 2.0 background.
I do know a little about Spring but certainly not the finer aspects like how it handles distributed transactions etc.
Hope that helps.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thing with Spring is that you create Pojos you don't have to create any classes or such that have to be set up for transactions. In the SPring Framework you can just create a bean called "transactionManager" and have any Transaction Manger implementation that you want. So if you want distributed transactions, then make it a JtaTransactionManager, but you will need to include that implementation's jar, but that is the same for any Java app that you want to use a class that is in some jar, you have to include that jar in the classpath.

Mark
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark.What you said is a more detailed explanation of my vague knowledge about spring transaction mechanism.
However, I am still not able to understand the assertion in this article that POJO facade is not good for distributed transactions and that a EJB session facade is better.
If you can please spend some time going over this article, you'll find that the author does mention "Spring" in a POJO facade approach, and still finds it incapable of handling a distributed transaction.

You may wonder why I don't ask this question in the same web site that is being referred, but I couldn't find a way to pose a question to the author there.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by aditee sharma:
Thanks Mark.What you said is a more detailed explanation of my vague knowledge about spring transaction mechanism.
However, I am still not able to understand the assertion in this article that POJO facade is not good for distributed transactions and that a EJB session facade is better.
If you can please spend some time going over this article, you'll find that the author does mention "Spring" in a POJO facade approach, and still finds it incapable of handling a distributed transaction.

You may wonder why I don't ask this question in the same web site that is being referred, but I couldn't find a way to pose a question to the author there.



That article is over 2 1/2 years ago. Technology has changed way too much. So I wouldn't take what is said about distributed transactions as true today. It might still be, but I wouldn't want you to get confused. Oops.

Mark
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see, thanks. So that's why I din hear anything from the recruiter the other day, after that interview
 
Ranch Hand
Posts: 218
VI Editor Ruby Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After reading at the article that you linked, it was a bit of misleading because the author is implicitly comparing Remote Session Bean against the POJO.

Basically any POJO facade that you implement with Spring is comparable to Local Session Bean, which based on the author assertion also can not be part of distributed transaction when called by remote client...because they can't be called remotely.

So the limitation of POJO facade is not the POJO itself, but totally depend on the remoting strategy that you choose. With EJB your only option is Remote EJB. With POJO facade you can choose many options of remoting that is supported by Spring, if those remoting option can support distributed transaction .. then your POJO facade can be part of the distributed transaction.
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


With POJO facade you can choose many options of remoting that is supported by Spring



Thanks Wirianto for such a direct answer.
So, how do we specify a remoting strategy when using a POJO facade with Spring? Is it through the transaction manager or something else?
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by aditee sharma:


Thanks Wirianto for such a direct answer.
So, how do we specify a remoting strategy when using a POJO facade with Spring? Is it through the transaction manager or something else?



Actually it is as simple as declaring a bean in which the class is the remoting technology that you want to use Exporter class. Spring uses and Exporter class to expose your POJO in that remoting technology. So for RMI, RMI-IIOP, or their HttpInvoker.

And on the client side there are Factories that can create a proxy that implements your POJOs interface and handle the remote calling, and also making Exception handling easier with unchecked exceptions.

For instance with RMI, you don't have to catch RemoteExceptions, your interface doesn't have to extend Remote interface, etc.

Mark
 
aditee sharma
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Mark, that was very informative.
From this point, it should be easier to google and learn the intricacies of distributed transaction in Spring.
 
reply
    Bookmark Topic Watch Topic
  • New Topic