1 / 22

JAVA Components

JAVA Components. Seminar of “Component Based Software Engineering” course By : Z.Varamini U niversity of S cience and T echnology of M azandaran, B abol January 7,2010. Outline. Introduction to Java From Java to Java 2 Java 2 platforms Java Components

hanh
Download Presentation

JAVA Components

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

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

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

  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

  6. Java-Components • Java component model : • Applet • JavaBeans • Enterprise JavaBeans • Servlets • Application client components J2SE J2EE JAVA Components

  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

  8. Problems In Netscape and IE • They didn't keep up with more modern versions of Java • To overcome this problem, Sun released a tool called the "Java Plug-in" • 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

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

  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. JAVA Components

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

  12. JavaBeans – Main aspects • Events • Properties • Introspection • Customization • Persistence JAVA Components

  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

  14. EJB Vs JavaBean • Components built in the JavaBeansspecification 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 multipleaddress 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

  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 Components

  16. What constitutes an EJB? • EJB ObjectClient 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 Components

  17. What constitutes an EJB?(cont.) • Home ObjectHow do clients acquire references to EJB objects? The client asks for the EJB object fron the EJB Object factory • Home InterfaceHow does a Home object know how you would like to intialize your EJB object? This info is provided to the containerthrough Home interface JAVA Components

  18. What constitutes an EJB?(cont.) • Local InterfacesCreating 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 DescriptorYou state your middleware needs in the deployment descriptor. This file is an XML based file • EJB-jar filesEJB-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 Components

  19. What Specify in Deployment Descriptor ? • Bean management and lifecycle requirements • Transaction requirements • Security requirements, including access control entries JAVA Components

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

  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 Components

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

More Related