Skip to main content

Posts

Showing posts from November, 2011

Overview of EJB and Lifecycle

The container is responsible for loading, activating, and in general maintaining the "life-cycle" of objects it provides. EJB have a fairly complex life-cycle. There are several kinds of EJB: Session Beans: These may be either stateful or stateless, and are primarily used to encapsulate business logic, carry out tasks on behalf of a client, and act as controllers or managers for other beans.   Entity Beans: Entity beans represent persistent objects or business concepts that exist outside a specific application's lifetime. They are typically stored in a relational database. Entity beans can be developed using bean-managed persistence, which is implemented by the developer, or container-managed persistence, implemented by the container.   Message-Driven Beans : Message-driven beans listen asynchronously for Java Message Service (JMS) messages from any client or component and are used for loosely coupled, typically batch processing.

Basics of Encapsulation Inheritance & Polymorphism

Encapsulation: Hiding the data/methods inside the object is called the Encapsulation. In Structured programming when u want to have a variable having accessible by some part and not by other part u don't have a mechanism to achieve the same. Encapsulation provides the same mechanism, if a class or a function wants to access then it should access those variables and functions from the references of the class i.e. objects. Inheritance Inheritance enables you to create a class that is similar to a previously defined class, but one that still has some of its own properties. Polymorphism The last major feature of object-oriented programming is polymorphism. By using polymorphism, you can create new objects that perform the same functions as the base object but which perform one or more of these functions in a different way. For example, you may have a shape object that draws a circle on the screen. By using polymorphism, you can create a shape object that draws a rectangle instead

Ant Tutorial

Build.xml is the backbone file for running ANT. It has one project tag and at least one target tag. Project Tag has three attributes Name:- Project Name Default:-Default target to be called Basedir:- Basic Directory to do the needful.(More specifically it contains the absolute path.) Example: <project name="My Project" default="compile" basedir="."> Then the target tag Name:- target name(Required) Depends:-if dependent on other targets..(We can even use if statement like if there exist the property then the target is dependent on other target ) Description:- description. Example : <target name="clean" description="Removing the all generated files."> <delete dir="${dir.build}"/> <delete dir="${dir.dest}"/> </target> Then the property tag. Name:-name of the property Location:- It contains the property name. Value:- we can place the property value between ${&q