Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Difference pojo and ejb

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between pojo's and ejb.
And how ejb's are distributable and scalable.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, welcome to the ranch!

EJB is a framework and a container. Your classes run within the context of the container. EJB is a very "intrusive" framework, meaning your classes will have many references to things that come with the container like superclasses and utilities. That makes it tough to move your code out of EJB into some other framework or to test it without firing up the whole container.

POJO means Plain Old Java Object and just means a class with no ties to the framework and container. With no imports or dependencies on the container, you can move a POJO to another framework or container and test it without starting up the container.

This distinction came about because folks tried EJB and found it too complex and too intrusive. There are a number of POJO frameworks like Spring with a goal of being less intrusive and complex. Often when you hear somebody talk about POJO they are being critical of EJB or claiming to have something simpler and better.

My team uses another framework, and we also talk about POJO as "not part of the framework". We mix minimal framework classes that delegate much of the work to POJOs. It's a tough balancing act but it can pay off.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't even touch your second question yet! EJBs are distributable or remotable because you can call them from another JVM, on the same or another computer.

They are scalable because - if you do it all carefully - the server is stateless and you can add more servers in a cluster. So if you get a thousand new users and need more capacity, you can add more server instances to the cluster. For example my project runs in 6 "clones" of WebSphere running on 3 "nodes" or computers and we're giving some thought to 12 clones in two geographic locations.

I'd suggest Ed Roman's "Mastering EJB" book, available online as a PDF if you google around a bit. Give it a try and see if it starts out where you are. If it's too advanced, ask the gang for more recommendations.

Hope that helps!
[ May 29, 2006: Message edited by: Stan James ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic