330 likes | 437 Views
Assignment of JAVA. Email id : Engnr.shehzad@gmail.com BSSE-F10-M-10-JAVA1. Lecture 5. Technologies of J2EE By Mr. Muhammad Shehzad. Review. Traditional enterprise application providers have changed over from 2-tier, client-server application models to three-tier application models.
E N D
Assignment of JAVA • Email id : • Engnr.shehzad@gmail.com • BSSE-F10-M-10-JAVA1
Lecture 5 Technologies of J2EE By Mr. Muhammad Shehzad
Review • Traditional enterprise application providers have changed over from 2-tier, client-server application models to three-tier application models. • The rapid development of this new model was fuelled by the introduction of various middleware services. • A developer is usually faced with a range of problems while developing an enterprise-wide application. • The different problem domains include: • Programming productivity • Response to demand • Integration with existing systems • Freedom to choose • Maintaining security • The mission of J2EE is to provide a platform-independent, portable, multi-user, secure and standard enterprise-class platform for server-side deployments written in the Java language.
Review Contd… • The J2EE specifications include those to: • Design the enterprise application • Distribute Roles to people involved in developing the software (Project/Product) i.e. J2EE specifies the rules of engagement that people must agree on when writing enterprise software • Bundle the files to the clientProgramming productivity • Standardize the technologies that could be used in J2EE • Standardize the interaction between the different technologies
Review Contd… • The various J2EE components include: • Application components • Containers • Resource manager drivers • Databases • The J2EE platform communicates with the outside world in different ways. These ways, known as contracts, are well defined, and separated into: • APIs • Network protocols • Deployment descriptors • One of the most important concepts in J2EE is a platform role. The J2EE standard provides separation between different roles, so that different players in the market can specialize in their role. These roles include: • J2EE Product Provider • Application Component Provider
Review Contd… • One of the most important concepts in J2EE is a platform role. The J2EE standard provides separation between different roles, so that different players in the market can specialize in their role. These roles include: • J2EE Product Provider • Application Component Provider • Application Assembler • Deployer • System Administrator • Tool Provider • The J2EE Platform provides several benefits such as: • Simplified architecture and development • Integrating existing enterprise information systems • Scaling • Security
The Objectives… • Describe the various technologies involved in J2EE • Explain the component technologies • Discuss the service technologies • Describe the communication technologies
J2EE Technologies categories Component Technologies Communication Technologies JDBC Java Applets and Applications JNDI Internet Protocols Java Transaction API XML JSP EJB HTML RMI JavaMail Servlets Service Technologies Client-side Technology JMS
Component Technologies Servlets JSP EJB JavaBeans
Servlets • Server-side programs • No interface • Form basic building blocks of web applications • Provide the means to extend and enhance web servers • Can be used to generate dynamic content Server Client Servlet Applet
JSP (Java Server Pages) • Extension of servlet technology • Created to support authoring of HTML and XML pages • Easier than servlets to combine static data with dynamic content • More suited for separating application logic from presentation logic Server Web Server Servlet invoked JSP Compiled by web server Result Returned JSP Client
Used to develop business logic Allow separation of app logic from system level services To use services provided by J2EE, business components are implemented by EJB components/Enterprise beans Enterprise JavaBeans Server Middle Tier ----- ----- ----- Application logic ----- ----- ----- System level services Client
Does the tasks Does the tasks Enterprise Beans Session Beans Entity Beans Used exclusively by clients that created them Bean Data Stateless Stateful Client • Wrapper for data easing access to data • Instance of bean can be shared by multiple clients Client Client Bean destroyed Bean exists Client Client Persists only as long as request is being processed Exists as long as session exists
Generally, containers take care of required J2EE services for components Developer focuses on business logic Sometimes services may need to be explicitly called Developer Service Technologies SERVICES Components Develops
Java Transaction API & Service Components of Distributed Transaction System Resource Manager Application Server Transactional Applications Java Transaction Service specifies the implementation of the Transaction Manager Java Transaction API Most important component in a transaction processing environment Transaction Manager Creates transactions requested by components, and performs 2-phase commit recovery protocol with Resource Managers
TRANSACTION -------- ------- ------- ------- Transactions Database Records A tomic onsistent C Group of operations performed on data I solated D urable
Transaction Begins Request sent to Transaction Manager to initiate transaction Transaction Manager starts transaction & associates it with thread that initiated the process Transaction Manager creates transactional context -which is shared by all relevant components & threads Transaction Ends Thread issues commit or rollback request
Communication Technologies Communication Technologies Component Service
Internet Protocols Request processed Sends request Server Results sent Web-based, distributed, enterprise applications scenario Client
HTTP • Set of rules for exchanging files on the World Wide Web
Internet TCP/IP IP picks up packets, and ensures that they reach destination. TCPtracks the packets TCP assembles packets after checking for errors, missed packets etc. TCP breaks up data into packets
SSL Encrypted data transmitted SSL Data Encrypted Data
Java Mail JavaMail • Used to exchange messages between users • Supports SMTP, POP, IMAP4 • Slower than JMS
Internet XML • For distributing structured information over the Internet • Data interchange format in web- based applications-- XML e-Commerce SCM Application Integration XML
The Power of XML Changes are updated to 2 different databases SQL Server Database XML Oracle Database ------ ----- ----- ----- Appropriate presentation style applied XML XML Same data can be presented in a variety of ways, to a variety of devices
HTML XML Tags defined by developer Fixed predefined tags ---- ---- ---- ---- ---- ---- Handles content & presentation Handles ONLY content XSL/CSS CSS Can be optionally used to take care of presentation Transforms XML by applying styles to it Browser interprets HTML code
J2EE Technologies Component Technologies Service Technologies Client-Side Communication Technologies EJB JSP Servlets JNDI JavaBeans JDBC Java Transaction API & Service Internet Protocols Other Protocols Session Beans Entity Beans HTTP SSL TCP/IP JavaMail JMS RMI
Summary • The J2EE technologies can be broadly classified into four different categories: • Client-side technologies • Component technologies • Service technologies • Communication technologies • Component technologies include: • Servlets • Java Server Pages • Enterprise JavaBeans • Session Beans • Entity Beans
Summary • Service Technologies include: • Java Database Connectivity • Java Transaction API and Service • Java Naming and Directory Interface • Transaction - A transaction is a group of operations that are carried out as a single unit on records stored in a database. The group must have a set of characteristics in order to be considered as transactional. • ACID properties include • Atomic • Consistent • Isolated • Durable
Summary Contd... • The Java Naming and Directory Interface, JNDI in short, is a naming service. • A namingservice associates a name with an object, so that clients can locate the object using the specified name. • A directoryservice on the other hand, allows attributes as well as names to be associated with objects. • Internet Protocols include: • HTTP • TCP/IP • SSL
Summary Contd... • Remote Object Protocols include: • RMI and RMI-IIOP • Java IDL • JMS • JavaMail • XML or Extensible Markup Language is the most popular tool to distribute structured information over the Internet. • XML is used for structured information management. • XML can also be used to create customized views of data . • XML documents come in two flavors – well formed and valid. • J2EE deployment descriptors are written in XML based on predefined DTDs