Presentation is loading. Please wait.

Presentation is loading. Please wait.

JAVA Components Seminar of “Component Based Software Engineering” course By : Z.Varamini University of Science and Technology of Mazandaran,Babol January.

Similar presentations


Presentation on theme: "JAVA Components Seminar of “Component Based Software Engineering” course By : Z.Varamini University of Science and Technology of Mazandaran,Babol January."— Presentation transcript:

1 JAVA Components Seminar of “Component Based Software Engineering” course By : Z.Varamini University of Science and Technology of Mazandaran,Babol January 7,2010

2 Outline Introduction to Java From Java to Java 2 Java 2 platforms Java Components  Applet,JavaBeans,Enterprise JavaBeans JAVA Components 2/22

3 JAVA  Released in alpha-form in 1995 by Sun  Originality:Concepts of Applets  Java become common used by 1996 JAVA Components 3/22

4 Java 2 JAVA Components 4/22  Introduced in late 1998  Relegates applets to a marginal side role  Introduced the notion of platform editions

5 Java 2 Platforms J2SE:Java 2 Platform, Standard Edition Use for Standard Programming J2EE:Java 2 Platform,Enterprise Edition Released end 1999 The Flagship platform edition The most Successful Programming for Enterprise Systems J2ME:Java 2 Platform, Micro Edition Use for small and embeded device It was Successful in the mobile phone sector JAVA Components 5/22

6 Java-Components Java component model : o Applet o JavaBeans o Enterprise JavaBeans o Servlets o Application client components JAVA Components 6/22 J2SE J2EE

7 Applet-Policy Applet,Is a software component that runs in the context of another program, for example a web browser With Goal of adding Animation to Web Pages Sun's Hot Java browser,the first browser that supports Applet Netscape and Microsoft Internet Explorer,Then supports Applet when included a Java virtual machine JAVA Components 7/22

8 Problems In Netscape and IE They didn't keep up with more modern versions of Java o To overcome this problem, Sun released a tool called the "Java Plug-in " o it seamlessly plugs in to both Netscape and Internet Explorer and allows both browsers to execute Java applets by using an external Java runtime environment that Sun supplies JAVA Components 8/22

9 Life Cycle of an Applet Four Method Controls An Applet JAVA Components 9/22 Init() Start() Stop() destroy() Browser,Load its page user moves off the page User returns to the page Browser shuts down normally

10 JavaBeans- What is ? JavaBeans are reusable software components for Java that can be manipulated visually in a builder tool. Practically, they are classes written in the Java programming language conforming to a particular convention. They are used to encapsulate many objects into a single object (the bean) A JavaBean is a Java Object that is serializable, has a nullaryconstructor, and allows access to properties using getter and setter methods. 10/22 JAVA Components

11 JavaBeans- Solution to.. Enables Software developers to design and create reusable pieces of software that easily integrate o with each other o with applications o with development tools 11/22 JAVA Components

12 JavaBeans – Main aspects Events Properties Introspection Customization Persistence JAVA Components 12/22

13 Enterprise JavaBeanse (EJB) Provide a framework for component that may be “plugged in” to a server Enterprise JavaBeans is totally different of JavaBeans,Except that it uses some similar concepts JAVA Components 13/22

14 EJB Vs JavaBean Components built in the JavaBeans specification are intraprocess components that stays in one address space and are typically used for Graphical User Interface (GUI) as visual widgets like buttons, tables, HTML viewers, etc Components built in the EJB specification are interprocess components that stays in multiple address spaces as distributed object. EJBs are not GUI components rather they sit behind the GUI's and perform all the hardcore business logic. GUIs like thick Clients, web-based Clients and web services are some of the Clients that can make connection to EJBs JAVA Components 14/22

15 Enterprise JavaBeanse-Goals Easy for developers to creat applications Standard way for client/server applications Compatible with and uses other java APIS EJB can interoperate with non-java apps EJB is Compatible with CORBA JAVA Components15/22

16 What constitutes an EJB? EJB Object Client never invokes the method on an actual bean instance. All invocations go through the EJB Object Remote Interface This interface duplicates all the methods that the corresponding bean class exposes JAVA Components16/22

17 What constitutes an EJB?(cont.) Home Object How do clients acquire references to EJB objects? The client asks for the EJB object fron the EJB Object factory Home Interface How does a Home object know how you would like to intialize your EJB object? This info is provided to the container through Home interface JAVA Components17/22

18 What constitutes an EJB?(cont.) Local Interfaces Creating the beans through the home interface and then calling the beans though the remote interface is very slow. Local Interfaces makes beans' call faster Deployment Descriptor You state your middleware needs in the deployment descriptor. This file is an XML based file EJB-jar files EJB-JAR files are essentially zip files that contain Java classes and other files needed for deployment. You can generate these files by hand or with tools, such as Apache Ant. JAVA Components18/22

19 What Specify in Deployment Descriptor ? Bean management and lifecycle requirements Transaction requirements Security requirements, including access control entries JAVA Components19/22

20 Enterprise JavaBeans Component JAVA Components 20/22 EJB Server EJB Container EJB Home EJB Object EJB Bean EJB Home stub EJB Object stub Home Remot or Local Home Remot or Local Client

21 Disadvantages of EJB They have a large and complicated Specification EJBs take longer to develop, and when things go wrong, they can be more difficult to debug, because there can be a possibility that the bug may not be in your code but in the application server/container itself. No sooner have you deployed your EJB application, you see a new specification with newer features, rendering your application obsolete before it gets online. This situation, however, is unavoidable. JAVA Components21/22

22 Reference Clemens Szyperski, Dominik Gruntz and Stephan Murer, "Component Software - Beyond Object- Oriented Programming",Second Edition, Addison- Wesley/ACM Press, 2002 (589 pages), ISBN en.wikipedia Cay S. Horstmann, Gary Cornell,” Core Java™ 2 Volume I - Fundamentals”, Seventh Edition, Prentice Hall PTR, August 17,2004(784 pages) ISBN JAVA Components 22/22


Download ppt "JAVA Components Seminar of “Component Based Software Engineering” course By : Z.Varamini University of Science and Technology of Mazandaran,Babol January."

Similar presentations


Ads by Google