Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is java bean a distributable component like EJB?  RSS feed

 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is java bean a distributable component like EJB?
If yes then why is ejb used most often then java bean.?
Why cant we use a Bean managed in a java bean?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Javabean (the non-GUI kind) is just a POJO (Plain Old Java Object) with getter/setter methods.
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u be more brief on this concept POJO..chris..
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chris referring to normal java class with private instance variables, having setter and getter method for each instance variable.
This type of java bean is used pass the set of values bundled as one object. Even used in places where values are set at different part of the code for each instance variable and used at one or many places.
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure if this is a valid answer.
A distributable component s'd be accessible across a network. It's about interacting with a component residing somewhere else in the network as though it resides locally.
A normal java bean cannot be accessed across
virtual machines and hence does not make sense in distributed computing.

Originally posted by senthil sen:
is java bean a distributable component like EJB?
If yes then why is ejb used most often then java bean.?
Why cant we use a Bean managed in a java bean?
 
senthil sen
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well so can we say if a call with private properties and with accessor methods is a java bean??
 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Java bean is a simple java class with some getter & setter method for it's local variables. Java beans is not a complete application insted they can be a small part of big application.
Also, EJB is giving the enterprise facility to the programmer. That means programmer doesn't have to concentrate on the system levle work while writing the bean he/she have to concentrate only on the busineess logic. As a EJB, it offeres security, transaction support inbuild for ejb.
In a javabean you have to manage all these hairy issues on your own. EJB makes the system programmeing and business logic saperate.
For all of the above reasons IT inducsrty preferes EJB over simple javabeans.
 
Vijayakumar Arya
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There are other technologies available if you are looking for Distributive computing, they are RMI, CORBA, and DCOM.
RMI is another distributive technology available from Java, EJBs use this as base to provide the distributive computing power.
You can use RMI if you are looking only for Distributive computing, i.e. executing methods on other Java/ CORBA objects that are available in the network.
Use EJB's if you are going to utilize other enterprise resources like Relational Databases, Messaging, LDAP, Legacy applications. Bcos J2EE framework provide an uniform framework for accessing each class of application. I refer to JDBC, JMS, JCA to name a few frameworks available with J2EE. This reduces the programming effort very much in integrating various applications to our application. Also changing the vendor is also code independent.
For instance if you are switching from Access to SQL you need not recode your application if you have used JDBC to access the database and the data schema remains the same. This is just an example the advantages of J2EE are many.
Hope this helps.
---------------
Vijay
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!