Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed system examples

Similar presentations


Presentation on theme: "Distributed system examples"— Presentation transcript:

1 Distributed system examples
Commercial middleware J2EE Overview .NET Overview Web services: where middleware systems meet Web service from Open Source middleware 11/22/2018 Distributed Systems - Comp 655

2 Distributed Systems - Comp 655
Java EE Overview The problem Java EE attempts to solve: maximize the use of Java technologies by providing a suite of Java technology specifications that is Integrated Suitable for enterprise applications Widely available Includes all of the basic middleware capabilities for building distributed systems 11/22/2018 Distributed Systems - Comp 655

3 Enterprise applications require
High throughput Load balancing Efficient communications High availability Highly reliable communications Persistent, asynchronous communication option Distributed transactions High security Ability to interoperate with whatever Structured naming with de-centralized administration 11/22/2018 Distributed Systems - Comp 655

4 Distributed Systems - Comp 655
Trademarks etc Java, J2EE, J2SE, J2ME, and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Graphics on pages 3, 4, 5 Copyright © Sun Microsystems, Inc. All Rights Reserved. 11/22/2018 Distributed Systems - Comp 655

5 Distributed Systems - Comp 655
The 3 Cs of Java EE Components Containers Connectors 11/22/2018 Distributed Systems - Comp 655

6 Distributed Systems - Comp 655
J2EE Overview 11/22/2018 Distributed Systems - Comp 655

7 Distributed Systems - Comp 655
J2EE Structure 11/22/2018 Distributed Systems - Comp 655

8 Key middleware services
Communication: RMI-IIOP, JMS Naming: JNDI (part of Java SE) Persistence: JPA, JDBC, JDO Transactions: JTA, JTS Security: (next page) 11/22/2018 Distributed Systems - Comp 655

9 Java SE v1.4 Security Features
JAAS – Java Authentication and Authorization Service JCE – Java Cryptography Extension JSSE – Java Secure Socket Extension Java GSS-API – Kerberos V5 secure communications Java Certification Path API 11/22/2018 Distributed Systems - Comp 655

10 Java EE for web services
Java Architecture for XML Binding (JAXB) Java API for RESTful Services (JAX-RS) Java API for XML-Based Web Services (JAX-WS) SOAP with Attachments API for Java (SAAJ) Java API for XML Messaging (JAXM) Java API for XML Processing (JAXP) Java API for XML Registries (JAXR) Java API for XML-Based Remote Procedure Call (JAX-RPC) Two leading registry standards: ebXML Registry and Repository standard, UDDI (Universal Description, Discovery, and Integration) SOAP was originally part of JAXM 11/22/2018 Distributed Systems - Comp 655

11 Distributed Systems - Comp 655
Enterprise Java Beans Session beans Represent business processes and data about an interaction with a client Two types: Stateless Stateful Entity beans (FROZEN at EJB 2.5) Represent persistent data and data integrity rules Two types of persistence: Container-managed persistence Bean-managed persistence 11/22/2018 Distributed Systems - Comp 655

12 Distributed Systems - Comp 655
Invoking an EJB method EJB Container Home Object 3 Request new EJB object 5 Return EJB object reference Client EJB Object 4 Create EJB object 6 Invoke method JNDI NS, eg LDAP Request home object 1 2 Return home object reference 7 Delegate request to enterprise bean(s) Enterprise Bean(s) 11/22/2018 Distributed Systems - Comp 655

13 Distributed Systems - Comp 655
A familiar look to it … 11/22/2018 Distributed Systems - Comp 655

14 Distributed Systems - Comp 655
Message-driven beans MDB are stateless beans that Listen for and handle JMS messages Participate in transactions if necessary MDB have no Home interface Remote interface Interfaces directly callable by clients (clients just send messages) An MDB tutorial An MDB article 11/22/2018 Distributed Systems - Comp 655

15 If you remember one thing
Enterprise beans are Single-threaded Ignorant of security Ignorant of transactions Ignorant of networking The container handles all that Containers tend to be pricey 11/22/2018 Distributed Systems - Comp 655

16 Leading EJB containers
Oracle/BEA Weblogic IBM Websphere JBoss (open source) GlassFish (open source) Geronimo (open source) 11/22/2018 Distributed Systems - Comp 655

17 Deployment descriptors
Deferred binding for many of the things the bean developer need not worry about, including Access control Transaction requirements Persistence parameters Type of bean Classes used for home and remote interfaces 11/22/2018 Distributed Systems - Comp 655

18 Deployment descriptor example
<?xml version="1.0" encoding="ISO "?> <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" " <ejb-jar> <description>Deployment descriptor for the samplemdb JOnAS example</description> <display-name>samplemdb example</display-name> <enterprise-beans> <message-driven> <description>Describe here the message driven bean Mdb</description> <display-name>Message Driven Bean Mdb</display-name> <ejb-name>Mdb</ejb-name> <ejb-class>samplemdb.MdbBean</ejb-class> <transaction-type>Container</transaction-type> <acknowledge-mode>Auto-acknowledge</acknowledge-mode> <message-driven-destination> <destination-type>javax.jms.Topic</destination-type> <subscription-durability>NonDurable</subscription-durability> </message-driven-destination> </message-driven> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> 11/22/2018 Distributed Systems - Comp 655

19 Distributed Systems - Comp 655
Java EE 5 Replaces the well-established “J2EE” with a similar but less-pronounceable name  Emphasis: make enterprise development easier EJB 3 Web services Persistence Dependency injection Summary of changes 11/22/2018 Distributed Systems - Comp 655

20 Distributed Systems - Comp 655
EJB 3 Developer does not have to implement EJB interfaces EJB interface implementations inferred from annotations (for In many cases, explicit deployment descriptors are not needed In many cases, deployment information can be inferred from annotations (for Enterprise beans frozen at version 2.5, replaced by Java Persistence API (JPA), based on Hibernate 11/22/2018 Distributed Systems - Comp 655

21 Distributed Systems - Comp 655
EJB 3, continued In many cases, explicit JNDI lookups are not necessary In many cases, system can infer the required lookup from annotations (for 11/22/2018 Distributed Systems - Comp 655

22 Distributed Systems - Comp 655
EJB roles Source: Mastering Enterprise JavaBeans, Second Edition, by Ed Roman, Scott Ambler, and Tyler Jewell 11/22/2018 Distributed Systems - Comp 655

23 Web sites (3 of thousands)
Sun’s J2EE site: Mastering EJB 3.0 (downloadable) EJB design patterns (downloadable) J2EE Architect’s Handbook (downloadable) 11/22/2018 Distributed Systems - Comp 655

24 Dissent: Spring framework
Java EE should be easier to use It's best to program to interfaces, rather than classes. Spring reduces the complexity cost of using interfaces to zero. JavaBeans offer a great way of configuring applications. OO design is more important than any implementation technology, such as Java EE. Checked exceptions are overused in Java. A framework shouldn't force you to catch exceptions you're unlikely to be able to recover from. Testability is essential, and a framework such as Spring should help make your code easier to test. Our philosophy is summarized in Expert One-on-One J2EE Design and Development by Rod Johnson. 11/22/2018 Distributed Systems - Comp 655

25 Spring’s positive goals
Spring should be a pleasure to use Your application code should not depend on Spring APIs Spring should not compete with good existing solutions, but should foster integration. (For example, JDO, Toplink, and Hibernate are great O/R mapping solutions. We don't need to develop another one.) 11/22/2018 Distributed Systems - Comp 655

26 Distributed Systems - Comp 655
Coming soon: Java EE 6 Defined by JSR 316 Adds JAX-RS (JSR 311) Web Beans (JSR 299) Java Authentication SPI for containers (JSR 196) Removes EJB Container-managed persistence JAX-RPC And other changes Approved over a variety of concerns and objections 11/22/2018 Distributed Systems - Comp 655

27 Distributed Systems - Comp 655
.NET Overview The problem .NET tries to solve: maximize the sale of server-side licenses by providing a suite of Windows technologies that is Integrated Suitable for enterprise applications Includes all of the basic capabilities for building distributed systems Of course, Microsoft’s strategy for selling lots of server-side licenses includes other initiatives like Visual Studio.NET and the security turnaround 11/22/2018 Distributed Systems - Comp 655

28 Distributed Systems - Comp 655
.NET concepts What does it mean for an application to be “written in XML” ? 11/22/2018 Distributed Systems - Comp 655

29 Distributed Systems - Comp 655
.NET block picture 11/22/2018 Distributed Systems - Comp 655

30 .NET programming languages
11/22/2018 Distributed Systems - Comp 655

31 Key middleware services (.NET)
Communication: SOAP, http, ORPC Naming: URI, DNS, COM+ Catalog, Windows Registry Persistence: ADO, OLE-DB Transactions: MTS Security: SSL, Kerberos, NTLM ORPC is DCE RPC with COM-specific enhancements Older technologies (registry, ntlm) will probably continue to be important behind firewalls for some time 11/22/2018 Distributed Systems - Comp 655

32 Distributed Systems - Comp 655
RPC in .NET 11/22/2018 Distributed Systems - Comp 655

33 RPC with SOAP Extension in .NET
Intercepting inbound requests and outbound responses should look familiar to Summer 03 people … 11/22/2018 Distributed Systems - Comp 655

34 Distributed Systems - Comp 655
J2EE vs .NET Microsoft says: .NET is faster You write less code and easier code with .NET Sun says: .NET is a closed system .NET is immature .NET lacks community java.sun.com/features/2002/07/rimapatel.html (NOTE: this is getting old) (Java in grade school?) 11/22/2018 Distributed Systems - Comp 655

35 Distributed Systems - Comp 655
J2EE vs .Net continued IBM says Only 26% of mid-market companies have Windows only .Net locks you into Windows Microsoft competes with its partners Our WebSphere-based J2EE platform is cheaper than a comparable server-side .Net platform Read all about it Of course, Microsoft might dispute IBM’s idea of what constitutes a “comparable” .Net platform 11/22/2018 Distributed Systems - Comp 655

36 Distributed Systems - Comp 655
Web Services Where middleware systems meet The idea: allow clients to find and interact with services over the web without regard to how the clients or services are built How do you do that? With standards … This is a MAJOR industry bandwagon, as you probably know Recall from week 1 the importance of standards for open systems REST (Representational State Transfer) is a class of interaction techniques that is well supported by the web already. REST advocates claim that the web already has everything you need for commerce. Web service advocates respond that with REST you are always building services from scratch, and it’s too hard to set up programmatic interaction. 11/22/2018 Distributed Systems - Comp 655

37 Distributed Systems - Comp 655
SOAP overview Protocols include HTTP, SMTP, TCP, MSMQ, … What’s the difference between RPC and request/ response? 11/22/2018 Distributed Systems - Comp 655

38 Distributed Systems - Comp 655
SOAP intermediaries 11/22/2018 Distributed Systems - Comp 655

39 Distributed Systems - Comp 655
SOAP is (v1.2) SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation specific semantics. msdn.microsoft.com/library/default.asp? url=/library/en-us/dnsoap/html/understandsoap.asp 11/22/2018 Distributed Systems - Comp 655

40 SOAP message structure
<soap:Envelope xmlns:soap=" <soap:Header> <!-- optional --> <!-- header blocks go here... --> </soap:Header> <soap:Body> <!-- payload or Fault element goes here... --> </soap:Body> </soap:Envelope> 11/22/2018 Distributed Systems - Comp 655

41 Distributed Systems - Comp 655
SOAP message example <soap:Envelope xmlns:soap=" <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from> </from> <to> </to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> 11/22/2018 Distributed Systems - Comp 655

42 SOAP response message example
<soap:Envelope xmlns:soap=" <soap:Body> <x:TransferFundsResponse xmlns:x="urn:examples-org:banking"> <balances> <account> <id> </id> <balance>33.45</balance> </account> <id> </id> <balance>932.73</balance> </balances> </x:TransferFundsResponse> </soap:Body> </soap:Envelope> 11/22/2018 Distributed Systems - Comp 655

43 SOAP error message example
<soap:Envelope xmlns:soap=" <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Insufficient funds</faultstring> <detail> <x:TransferError xmlns:x="urn:examples-org:banking"> <sourceAccount> </sourceAccount> <transferAmount>100.00</transferAmount> <currentBalance>89.23</currentBalance> </x:TransferError> </detail> </x:TransferFunds> </soap:Body> </soap:Envelope> 11/22/2018 Distributed Systems - Comp 655

44 SOAP extensibility example
<soap:Envelope xmlns:soap=" <soap:Header> <!-- security credentials --> <s:credentials xmlns:s="urn:examples-org:security"> <username>dave</username> <password>evad</password> </s:credentials> </soap:Header> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from> </from> <to> </to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> 11/22/2018 Distributed Systems - Comp 655

45 Distributed Systems - Comp 655
Must-understand <soap:Envelope xmlns:soap=" <soap:Header> <!-- security credentials --> <s:credentials xmlns:s="urn:examples-org:security" soap:mustUnderstand="1" > <username>dave</username> <password>evad</password> </s:credentials> </soap:Header> ... 11/22/2018 Distributed Systems - Comp 655

46 Distributed Systems - Comp 655
SOAP in HTTP 11/22/2018 Distributed Systems - Comp 655

47 Distributed Systems - Comp 655
SOAP in context SOAP is an extensible way to encode requests and responses in XML WSDL (Web Services Description Language) is a way to describe the requests and responses a web service uses UDDI (Universal Description, Discovery and Integration) is a way of locating web services 11/22/2018 Distributed Systems - Comp 655

48 Distributed Systems - Comp 655
WSDL WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. Protocol bindings described: SOAP 1.1, HTTP GET/POST, MIME 11/22/2018 Distributed Systems - Comp 655

49 Distributed Systems - Comp 655
UDDI UDDI enables a business to describe its business and its services discover other businesses that offer desired services integrate with these other businesses. 11/22/2018 Distributed Systems - Comp 655

50 Distributed Systems - Comp 655
Dissent: REST REST's proponents: the Web’s scalability and growth result directly from a few key design principles: Application state and functionality are divided into resources Every resource is uniquely addressable using a universal syntax for use in hypermedia links All resources share a uniform interface for the transfer of state between client and resource: Constrained set of well-defined operations Constrained set of content types, optionally supporting code-on-demand A protocol that is: Client/Server Stateless Cacheable Layered 11/22/2018 Distributed Systems - Comp 655

51 Distributed Systems - Comp 655
REST resources The previous slide came from Wikipedia’s article JAX-RS Roy Fielding’s dissertation started the “movement” Del.icio.us is a well-known (almost) example Joe Gregorio on REST and WS-* RESTful Web Services book 11/22/2018 Distributed Systems - Comp 655

52 Web service from open source
Two authors from HP Chris Peltz Claire Rogers Goal: set up a weather-forecast web service on a laptop, using all Open Source infrastructure 11/22/2018 Distributed Systems - Comp 655

53 Distributed Systems - Comp 655
Decisions, decisions … Linux distribution DBMS Programming language Java runtime Java IDE Web container Web service container Build environment Testing 11/22/2018 Distributed Systems - Comp 655

54 Distributed Systems - Comp 655
Linux distribution RedHat – closes the gap between Windows and Unix, good for Linux novices SuSE – good for existing Windows users Debian – used by well-seasoned Linux developers [selected] They also liked GNOME 11/22/2018 Distributed Systems - Comp 655

55 Distributed Systems - Comp 655
Open source database PostgreSQL – robust, full-featured MySQL – maximize Web application performance, but no stored procedures or triggers [selected] It took several tries to get MySQL installed, but it worked well once it was set up. 11/22/2018 Distributed Systems - Comp 655

56 Distributed Systems - Comp 655
Java SDK J2SE SDK from Sun Blackdown JDK BEA’s JRockit [selected, primarily for performance reasons] They liked the “M x N” threading model 11/22/2018 Distributed Systems - Comp 655

57 Another industry benchmark
TPC is best known for TPC-C, which pioneered the $/tpmC approach 11/22/2018 Distributed Systems - Comp 655

58 Distributed Systems - Comp 655
Java IDE vi or emacs NetBeans (based on Swing, considered more platform-independent) Eclipse (based on SWT, considered faster and more attractive on-screen) [selected] They liked Eclipse’s plug-ins HP is developing several plug-ins 11/22/2018 Distributed Systems - Comp 655

59 Distributed Systems - Comp 655
Web container Resin Jboss Jetty Tomcat [selected, for performance, stability, and because it’s the default web container for Apache Axis] They were able to start and stop Tomcat from Eclipse, with the help of a plug-in 11/22/2018 Distributed Systems - Comp 655

60 Web services container
They concluded that Apache Axis is currently the only “robust” open source web services platform. They recommend writing your own WSDL for complex services, but for simple ones, Axis’ Java2WSDL is OK. 11/22/2018 Distributed Systems - Comp 655

61 Distributed Systems - Comp 655
More on Apache Axis Some manual coding was needed to adapt their server-side code to the web service environment (example: had to make the Forecast class a Bean so it could be serialized) The hardest part was figuring out what had to change. One commenter on the ServerSide web site complained that they should have said more about the Axis serialization/deserialization classes, which he found very confusing. 11/22/2018 Distributed Systems - Comp 655

62 Distributed Systems - Comp 655
Build and test Ant for building. WSDL2Java from Axis generates a client proxy class from the WSDL. Handy for testing. Axis tcpmon for monitoring SOAP traffic. Web service testing tools JUnit Grinder Anteater PushToTest TestMaker [selected] TestMaker scripts are written in Jython 11/22/2018 Distributed Systems - Comp 655


Download ppt "Distributed system examples"

Similar presentations


Ads by Google