Completely confused

everwhere I go to see ejb definition i see just one thing-"it holds business logic". i am confused with what business logic means. can someone provide with example what business logic is and for what ejbs are actually used? i will be really grateful if someone clears my questions here. and yes i have come here after reading from tutorial and my j2ee book. i am thoroughly confused.

[390 byte] By [psychica] at [2007-11-27 6:19:25]
# 1
Business logic is the functionality of the program. Without any business logic, all you have is data (if even that).
-Kayaman-a at 2007-7-12 17:34:00 > top of Java-index,Java Essentials,Java Programming...
# 2
you mean to say the function for which the code is devised to run? as in a binary the way a binary search works?
psychica at 2007-7-12 17:34:00 > top of Java-index,Java Essentials,Java Programming...
# 3

> you mean to say the function for which the code is

> devised to run? as in a binary the way a binary

> search works?

No. When we talk about business logic we generally ignore the technical details of our implementation.

The business logic is an abstract idea that we are trying to conceptualize into a technical solution, such as a business problem.

For example, lets say you are a software developer and are working on a software that manages resources for a Widget factory. Some business logic you may include would be...

Get Widget Name...

Get Widget Parts...

Calculate Total Widget Weight...

These are abstract ideas of what a WidgetEJB session bean should be able to provide.

Your EJB interface may look something like this...

public String getWidgetName() throws RemoteException;

public HashMap retrieveWidgetPartList(String name) throws RemoteException;

public double calcTotalWeight(String name) throws RemoteException;

Your business needs are identified and the interface for your EJB is laid out. The actual BUSINESS LOGIC would be whatever code is needed in those EJB methods to return the appropriate value or perform the necessary functionality.

The Business logic is essentially the meat and potatoes of your EJB.

maple_shafta at 2007-7-12 17:34:00 > top of Java-index,Java Essentials,Java Programming...