File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring IOC, Spring AOP alongwith Spring JDBC, as a substitute for EJB3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring IOC, Spring AOP alongwith Spring JDBC, as a substitute for EJB3.1" Watch "Spring IOC, Spring AOP alongwith Spring JDBC, as a substitute for EJB3.1" New topic
Author

Spring IOC, Spring AOP alongwith Spring JDBC, as a substitute for EJB3.1

Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 271

Hi Ranchers,

Please let me know if we can ue Spring IOC, Spring AOP alongwith Spring JDBC instead of EJB 3.1

PANKAJ SHET
B.Sc.(I.T.), S.C.J.P., S.C.W.C.D., PGDAC(CDAC)
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9495
    
    2

EJB 3.1 uses annotations to inject container managed objects and in a similar manner, Spring injects objects by looking against the Spring container. So the idea is more or less the same, the only difference is that EJB 3.1 defines a set of standards / specifications on how to develop enterprise components that can be deployed to any container that implements the EJB standards. On the other hand Spring is a lightweight alternative and dictates that you could achieve the same without the need for a hefty container.

So to answer your question, yes you could use Spring along with any Spring module instead of EJB 3.1.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 271

Thanks Joe for your reply..!!
Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 271

Hi,

How can I prove the use of spring instead of EJB in my project?

We used to deploy EJB's on JBOSS. EJB's were used for database interactions and transactions using JDBC code in EJB's.

Does Spring need application server?
How can Spring be used with application server?



Regards,
-Pankaj.
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2431
    
  28

All spring needs is a web server. You can build a spring based web app and deploy into tomcat

At my last job, I had introduced Spring to the company, and one of the main selling points was that it doesn't need a container. What we had was we had this huge background processing job that would run on the cloud. Most of the code executed in this background job. There was some of this code that was shared with the front end. Before I joined, they had started implementing everything as EJBs. To run the background job, they deployed jboss on all the machines in the cloud, and would bring them up to execute the background job. Jboss was basically a glorified main method that could call EJBs

So, when we started switching over to Spring we could have the same services run on tomcat/simple java application/Hadoop, blah blah. By going with EJBs you are kind of tying yourself to an app server... Which might be perfectly fine if you are completely in an SOA mindset. If you are thinking of doing something different, spring gives you more flexibility.
Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 271

Hi Jayesh,

Web server comes into picture only when it is a web application.

Mine is desktop application, which used EJB and the application server JBOSS.

I wanted to show that the above same application, which is a desktop application was developed in Spring IOC and Spring AOP, instead of EJB and did not use EJB at all.

So, I need to prove the same, that my application used Spring IOC and Spring AOP instead of EJB?

How should I do this.?

Does Spring IOC and Spring AOP desktop application need an application server?


Regards,
-Pankaj.



Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 235
Nope, Spring does not need application server. You can use it for any kind of application.
Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 271

Hi,

Thanks a Lot for reply

but then how to handle transactions without the use of Application Server?

How can I prove the use of Spring IOC, Spring AOP and Spring JDBC?

When can I use Spring AOP for logging instead of other logging frameworks?

How can I prove the use of Spring instead of EJB?

Please help me for the same.

Regards,
-Pankaj.



Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2431
    
  28

Make a Proof Of Concept. Take one use case that is independent of other use cases and implement it in spring.

Spring can do transaction management and logging
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring IOC, Spring AOP alongwith Spring JDBC, as a substitute for EJB3.1