What is the difference between normal Java object and EJB

Showing Answers 1 - 18 of 18 Answers


  • Mar 14th, 2005

Java Object:it's a reusable componetEJB:is reusable and deployable component which can be deployed in any container

  Was this answer useful?  Yes


  • Apr 6th, 2005

Java Object: is a reusable component. 
EJB : is a distributed component used to develop business applications. Container provides runtime environment for EJBs.


  • Apr 26th, 2005

EJB is an Java object implemented according EJB specification. 
Deployability is a feature.

  Was this answer useful?  Yes


  • May 26th, 2005

Java objects are reusable components which are having variables, methods. 
EJBs are also reusable components which can be placed at server side, EJBs are distributed component and can be deployed in EJB Container.

  Was this answer useful?  Yes

Rangaraajan B

  • Jun 27th, 2005

when we need of abstract class and interface?

  Was this answer useful?  Yes

Thangamani Kasi

  • Jul 4th, 2005

Java Object is created by user whereas EJB Object is created by container.

  Was this answer useful?  Yes


  • Jul 9th, 2005

EJB is java object which complies to the EJB specification. EJB has some special features to address the problems like, Deployability on verious standardized servers, Transactions, Security, Persistence ..etc and increasing the reusability by externalizing these into deployment configurations


  • Jul 24th, 2005

java object: not reusable it canot be used in distributed environment it has special security or system like container 
ejb object: reusable used in distributed environment special security provided by ejb container

  Was this answer useful?  Yes

J. P. Naidu

  • Jul 28th, 2005

Both are objects no doubt. But the EJB is the having implicit services that are provided by the container, in which it is deployed, as per the EJB spects.

  Was this answer useful?  Yes


  • Aug 12th, 2005

Hi, I think everyone needs to brush their knowledge of basics in java and ejb. See a java object is like a live once instance and an ejb object works in a distrubuitable environment and it cab accessed remotely across connections

  Was this answer useful?  Yes

vamshidhar ghanpur

  • Aug 27th, 2005

I'll give u best....... 
Java object is difinitly a reusable code,it needs JVM,in which it runs. 
Ejb object is also a reusable code,it needs a container 
where this component is deployed,and managed. 
container provides run-time environment to Ejb objects. Ejb objects are mean to be distributed over the network remotely.

  Was this answer useful?  Yes


  • Aug 29th, 2005

As every thing in JAVA is implemented as objects so EJB is also a JAVA Object which is a distributed object hence can be used across multiple JVMs and of course is reusable.

  Was this answer useful?  Yes

Dheeraj Tanwar

  • Sep 5th, 2005

Yes, Simple JAVA object can't be accessed remotely but EJB object can be accessed remotely because EJB class extends Remote Interface.
Simple Java object generally work on web server but EJB object work on Application server like IBM product Weblogic and Websphere.?
Java object are not reusable because of security issue but EJB objects are reusable.?

  Was this answer useful?  Yes


  • Sep 12th, 2005

An EJB is maintained by application server where as a normal Java Object is not maintained by application server which means the services such as transaction,security,object pooling are not probagated to java object

  Was this answer useful?  Yes


  • Oct 20th, 2005

The world can exist without EJBs! But the basic purpose of writing EJBS is to save a programmer the effort of writing middleware services like transaction services, security, network services etc. Thankfully, a server that conforms to J2EE specifications provides these services free of cost! you don't have to write any code for getting these services. All you have to do is specify what service you want in a set of XML files called deployment descriptors. And rest is only about writing the business logic !

  Was this answer useful?  Yes


  • Apr 13th, 2006

  • Have no method bodies or functionality whatsoever; all methods are implicitly abstract.

  • Can be implemented on a class without affecting its ancestry.

  • Can be used as a flag (as is the case with Cloneable and Serializable) to indicate that something is allowed to happen to a class.

  • Cannot declare object attributes, but can implement static final attributes

  • Can emulate attributes only by declaring getter and setter methods, which will require an implementing class to fill them with code.

Abstract Classes:
  • Can have both implemented bodies with functionality and abstract methods. The implemented methods become shared code for the classes that extend the abstract class.

  • Can have private methods and attributes, just like an ordinary class.

  • Cannot be instantiated by definition; it must be subclassed in order to utilize its functionality.

Both Interfaces and Abstract Classes:
  • Require that a subclass or implementing class write method bodies for each of the methods in the interface or just the methods declared abstract in the abstract ancestor.

  • Can be used to cast objects that implement or subclass from them for the purpose of polymorphism.

  Was this answer useful?  Yes


  • Jun 11th, 2008

An EJB object is also an java object, but as it follows the EJB Specifications, it can be remotely identified in an Application server. An java object can be deployed in an application server, but cannot be idetified. i.e A java object can be in the classpath of an EJB or web application and can be put in the server and it can even contain business logic. But only EJBs can be identified by the JNDI (Java Naming Directory Interface). While deploying an EJB in an application server, like weblogic, we give a JNDI name to it, in the deployment descriptor and it can be only accessed using that name.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account

Send   Reset


Related Answered Questions


Related Open Questions