Bài giảng Lập trình mạng nâng cao: J2EE architecture - Nguyễn Xuân Vinh

90 78 0
Bài giảng Lập trình mạng nâng cao: J2EE architecture - Nguyễn Xuân Vinh

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Upon completion of this lesson, the successful participant will be able to: Understand enterprise application, know some type of architectural models, understand web service architecture, determine service-oriented architecture, understand and use some web service technologies, build a simple web service.

KHOA CÔNG NGHỆ THÔNG TIN OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM J2EE ARCHITECTURE Presenter: Nguyễn Xuân Vinh Information Technology Faculty Nong Lam University OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Objectives  Understand Enterprise Application  Know some type of Architectural Models  Understand Web Service Architecture  Determine Service-Oriented Architecture  Understand and use some Web Service technologies  Build a Simple Web Service s e r p Two-Tier Client Server Business Logic in middleware services 0s y l r Ea T MS Client Thin clients INTERNET ORBs MOM Server OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Building a Departmental Store Pay more attention to: $$ Pay less attention to: Location Constructing building Appropriate Items Interiors Discounts Electrical Connections Customer Satisfaction Your focus: Customer Satisfaction Employ experts to handle specific tasks OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Challenges of Enterprise Application Development Increase in number of users Change in vendor Client ity v ti c e Conn s Issue Server Different programming models MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Enterprise Application Process Conception Secure OF 90 08/05/21 Prototype Usability F e e d b a c k + re vi e w Enterprise Application OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Prototype Development Process User Requirements Functionality of the Application Prototype Design Prototype OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Final Application Process Prototype Design Enterprise Application Design Enterprise Application Reviewed Functionality of the Application MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Diverging Standards HTML WML 08/05/21 HDML OF 90 KHOA CÔNG NGHỆ THÔNG TIN                                                          Application Server Database Same data can be presented in a variety of ways, to a variety of devices 10 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Challenges Faced  Whether the application is capable of understanding different standards  Efforts required to understand the different standards  Efforts required to adapt to future standards 76 OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN JavaServer Faces Technology  JavaServer Faces technology is a user interface framework for building web applications  The main components of JavaServer Faces technology are:  A GUI component framework  A Renderer object generates the markup to render the component and converts the data stored in a model object to types that can be represented in a view  A standard RenderKit for generating HTML/4.01 markup  The following features support the GUI components:  Input validation  Event handling  Data conversion between model objects and components  Managed model object creation  Page navigation configuration  Expression Language (EL) 77 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN JavaServer Faces Technology  In the Java EE platform, new features of JavaServer Faces include the following:  The ability to use annotations instead of a configuration file to specify managed beans  Facelets, a display technology that replaces JavaServer Pages (JSP) technology using XHTML files  Ajax support  Composite components  Implicit navigation 78 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN JavaServer Pages StandardTag Library (JSTL)  The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP applications  Use a single, standard set of tags  JSTL can use tag for  Handling low control  Manipulating XML documents  Internationalization tags  Accessing databases using SQL  Some commonly used functions 79 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Persistence API (JPA)  The Java Persistence API is a Java standards-based solution for persistence  Persistence uses an object/relational mapping approach to bridge the gap between an object-oriented model and a relational database  Java Persistence consists of the following areas:  The Java Persistence API  The query language  Object/relational mapping metadata 80 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Transaction API (JTA)  Java Transaction API (JTA) provides a standard interface for demarcating transactions  Provides a default auto commit to handle transaction commits and rollbacks 81 OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java API for RESTfulWeb Services  The Java API for RESTfulWeb Services (JAX-RS) defines APIs for the development of web services built according to the Representational State Transfer (REST) architectural style  JAX-RS application is a web application that consists of classes that are packaged as a servlet in a WAR ile along with required libraries 82 OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Others  Managed Beans: specification is part of the Java EE platform specification (JSR 316)  Contexts and Dependency Injection for the Java EE Platform(JSR 299): defines a set of contextual services, provided by Java EE containers  Dependency Injection for Java (JSR 330): defines a standard set of annotations (and one interface) for use on injectable classes  BeanValidation: defines a metadata model and API for validating data in JavaBeans components  JavaMessage Service API: is amessaging standard that allows Java EE application components to create, send, receive, and read messages It is loosely coupled, reliable, and asynchronous 83 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Others  Java EE Connector Architecture  JavaMail API  Java Authorization Contract for Containers  Java Authentication Service Provider Interface for Containers 84 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java EE APIs in the Java Platform, SE 6.0  JavaDatabase Connectivity (JDBC) API  Java Naming and Directory Interface (JNDI) API  Java Beans Activation Framework (JAF)  Java API for XML Processing (JAXP)  Java Architecture for XML Binding (JAXB)  SOAP with Attachments API for Java (SAAJ)  Java API for XMLWeb Services (JAX-WS)  Java Authentication and Authorization Service (JAAS) 85 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Database Connectivity (JDBC) API  The Java Database Connectivity (JDBC) API lets you invoke SQL commands from Java programming language methods  The JDBC API has two parts:  An application-level interface used by the application components to access a database  A service provider interface to attach a JDBC driver to the Java EE platform 86 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Naming and Directory Interface API  Provide naming and directory functionality, enabling applications to access multiple naming and directory services  Include existing naming and directory services, such as LDAP,NDS,DNS, andNIS 87 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Naming and Directory Interface API  A Java EE component can locate its environment naming context by using JNDI interfaces  A component can create a javax.naming.InitialContext object and look up the environment naming context in InitialContext under the name java:comp/env  A component’s naming environment is stored directly in the environment naming context or in any of its direct or indirect subcontexts 88 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN Java Naming and Directory Interface API 89 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM KHOA CÔNG NGHỆ THÔNG TIN JNDI Example – Lookup.java package service; import java.util.Properties; import javax.naming.*; public class Lookup { public static void main(String[] args) { String name = ""; if (args.length > 0) name = args[0]; try { // Create a Properties object and set properties appropriately Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); props.put(Context.PROVIDER_URL, "file:///"); // Create the initial context from the properties we just created Context initialContext = new InitialContext(props); // Look up the object Object obj = initialContext.lookup(name); if (name.equals("")) System.out.println("Looked up the initial context"); else System.out.println(name + " is bound to: " + obj); } catch (NamingException nnfe) { System.out.println("Encountered a naming exception"); } } } 90 OF 90 08/05/21 MÔN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM HỎI ĐÁP KHOA CÔNG NGHỆ THÔNG TIN ... 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Figure - Implementing Web Services Using Java APIs 47 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XUÂN VINH TRƯỜNG... MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Figure - Business and EIS Tiers KHOA CÔNG NGHỆ THÔNG TIN Business Components 36 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN... MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN XN VINH TRƯỜNG ĐẠI HỌC NÔNG LÂM TP.HCM Figure  -Java EE Server and Containers KHOA CÔNG NGHỆ THÔNG TIN Container Types 42 OF 90 08/05/21 MƠN: LẬP TRÌNH MẠNG GV: NGUYỄN

Ngày đăng: 08/05/2021, 15:33

Mục lục

  • J2EE ARCHITECTURE

  • Objectives

  • PowerPoint Presentation

  • Building a Departmental Store

  • Challenges of Enterprise Application Development

  • Enterprise Application Process

  • Prototype Development Process

  • Final Application Process

  • Diverging Standards

  • Challenges Faced

  • Restructuring/Redeployment

  • Scalability

  • Managing System Resources

  • Integrating Existing Systems

  • Freedom to Choose

  • Security

  • Java EE Objectives

  • Slide 18

  • Java EE 6 PlatformHighlights

  • J2EE Application Model

Tài liệu cùng người dùng

Tài liệu liên quan