Date post: | 17-Jan-2015 |
Category: |
Technology |
Upload: | mert-caliskan |
View: | 6,397 times |
Download: | 0 times |
ENTERPRISE JAVA &
SOA
Mert ÇALIŞKAN
Doğu Akdeniz Üniversitesi
26.03.2012Friday, March 23, 12
Me?
• Mert ÇALIŞKAN
• Was working for a Defence Contractor...kind’a boring...
• Now Lead SOA Architect @ T2
• Open Source Software (OSS) AdvocateFounder and Committer for OS Projects
• Member of Apache Software FoundationOpenLogic Expert Community
Friday, March 23, 12
TO JAVA ? OR NOT ?
Come to the Dark Side..!
Friday, March 23, 12
Agenda
• History of Java
• Enterprise Java - mesir and its ingredients
• SOA, from principles to its elements
• Ways to make a better career in/with Java
• Q & A
Friday, March 23, 12
YOU KNOW THIS TRANS-ATLANTIC?
Friday, March 23, 12
• RMS Titanic sank in North Atlantic Oceanon 15 April, 1912 on maiden voyage
So Eventually Everything Dies...!Cool analogy, right? :)
• You, Me, All of Us...
• Companies, Technologies...
• Key point is: You should avoid not making it like Titanic, which sunk in 2hrs and 40 minutes...!
Friday, March 23, 12
Where it all began...
Founded February 24, 1982
Sold to Oracle January 27, 2010 for $7.4 billion..!
Sun was mainly selling Hardware, but they also working on computer software like Java, MySQL and NFS..
Founded in 1977 by Larry Ellison and a couple of clever guys, their motivation is to compete with IBM’s System R, which was a relational database.
Friday, March 23, 12
History of JAVA
• Java Language Project started in June 1991
(James Gosling and his fellas)
• Running byteCode on Java Virtual Machine
• WORA (Write Once, Run Anywhere)
• First started with applets in the WEB world
• With the dawn of Java Enterprise Edition, Servlets made their way to rule the world.
The DukeFriday, March 23, 12
Editions of JAVA
• Java Card: applets on smart cards (sim cards)
• Micro Edition (ME): mobile phones + set-top boxes
• Standard Edition (SE): Cool Software Platform
• Enterprise Edition (EE): Oracle’s Enterprise Computing Platform
• JavaFX: Aim was RIA (looks dead to me)
• PersonalJava (discontinued) : Java edition for mobile and embedded systems based on Java 1.1.8
Friday, March 23, 12
James Gosling... was the FATHER of Java
Larry Ellison... is the new BOSS
Age: 68
Age: 57$$$ makes you look
younger..!
Friday, March 23, 12
CHRONOLOGY OF JAVA SE
JDK 1.0 January 23, 1996
JDK 1.1 February 19, 1997
Introducing Abstract Window Toolkit
J2SE 1.2 December 8, 1998
Swing was on Board
J2SE 1.3 May 8, 2000
HotSpot JVM
J2SE 1.5 September 30, 2004
New Cool Language FeaturesGenerics, AutoBoxing, var-args & etc...
J2SE 1.4 February 6, 2002
reg-ex, Java Web Startembedded XML parser
Friday, March 23, 12
CHRONOLOGY OF JAVA SE
Java SE 6December 11, 2006
Java SE 7July 28, 2011
Java SE 8Summer, 2013
Best is yet to come..!lambda expressions... closures...
Multi-Catch in ExceptionsString in switch (finally!)
more cools features in the lang...
Renamed to Java SE instead of J2SE from now on.Support for running scripting lang. like Rhino.
Friday, March 23, 12
Enterprise JAVA
• Java EE = Java Enterprise Edition
• Extends Java SE
javax.faces.* UI + JSF Related Stuffjavax.servlet.* Handling HTTP invocations
javax.enterprise.inject.* CDI, Like Spring depedency Inj.javax.ejb.* EJB Stuff
javax.validation.* Bean Validationjavax.persistence.* Persistencyjavax.transaction.* Stuff for transactions
javax.jms.* Messaging Stuff
Friday, March 23, 12
CHRONOLOGY OF JAVA EE
Java EE 5May 11, 2006
Java EE 6December 10, 2009
J2EE 1.2December 12, 1999
J2EE 1.3 Sept. 12, 2001
J2EE 1.4 Nov. 11, 2003
Servlet 2.2 Servlet 2.3 Servlet 2.4
JSPEJBJMSJTAJAASJSFEL
JAX-WSJAX-RSJAX-BJPAJSTL
any manymore...
Servlet 2.5
Servlet 3.0
Friday, March 23, 12
How to choose the frameworks for WEB dev?
• Compatible with Model View Controller pattern
• Quality & Competency of “The Stack”
• Performance & Scalability
• Learning Curve & Development Speed ! don’t let cutting edge turn into bleeding edge...
• Community Factor & Open Source support (forums-mailing lists & etc.)
Friday, March 23, 12
Which stack to choose?
JSF
WebWork
Struts
Spring MVC
Tapestry
Spring Guice
Hibernate iBatis
Toplink KODO
EclipseLink
Model/Persistence Layer
picoContainer
Controller/Dep.Inj.
HiveMind
XWork
Apache CXF
Spring WS
IntegrationApache Axis2
UI
IDE
Eclipse IntelliJ IDEA
JDeveloper
Wicket GWT
NetBEANS
Cocoon
ZK
Echo3 Vaadin
Friday, March 23, 12
THE STACK of VIEW
CONTROLLERMODEL
JSF
MYFACESORCHESTRA
JPAHIBERNATE
ENVERS
SPRINGH.VALIDATOR
H.SEARCH
MAVEN
ECLIPSE
with SecuRITY
Apache CXF
Friday, March 23, 12
• It’s nothing new! not “yet another java framework”
• It’s a stack demonstration with OSS
• Released on 01.2009
• http://code.google.com/p/mesir
• 2000+ downloads
• Simple Stupid Model
1 0..*idtextcreationDatecontacts
idnameemailphone
AddressBook Contact
Friday, March 23, 12
Code walk-through with DEMO
Friday, March 23, 12
SOAService Oriented Architecture
Not SOAP...!
Ok, maybe it is...
Friday, March 23, 12
WHAT SOA IS ?
• Stands for Service Oriented Architecture
• Software Architecture where the whole information system is regarded as a collection of services interoperated and used freely through a common interface (the service bus) independent of hardware.
Friday, March 23, 12
WHAT SOA IS NOT ?
• It’s NOT a technical standard
• It’s NOT a technology
• It’s NOT a concrete architecture, but it leads to one.
• An application that uses web services is SOA (so wrong!)
Friday, March 23, 12
AIM OF SOA ?
• To INTEGRATE..!
• Services should interact, they must exchange information...
• Obey the ArchitecturalPrinciples...!
Friday, March 23, 12
ARCHITECTURAL PRINCIPLES
• Loose CouplingMinimize dependencies between each other, just aware of each other...
• Service ContractA set of technical data alongwith business information
WSDLXML
SchemaWS
Policy SLA
Friday, March 23, 12
ARCHITECTURAL PRINCIPLES
• Service AbstractionService Blocks on top of each other to build ServiceOriented Environment
Infrastructure Services
Business Services
Composite ServicesLevel of
Abstraction
• Service ReusabilityPositioning services as reusableenterprise resources
Friday, March 23, 12
Service Composability
• To re-use the capability of a service to build up composed services
A Big Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small problemscollectively represent a
big problem
Friday, March 23, 12
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
Small Problem
A B C D E F G H
Solution Logic that each address to solve a problem
A
B E
F
D G H
C
Big ProblemSolved
Service Composability
Friday, March 23, 12
Service Discoverability
• Descriptive services that can be accessed via discovery mechanisms
• Increase the service re-use...
• Services defined with WSDL and registered to services registry
• Next Step could be: WADLWeb Application Description Language
Friday, March 23, 12
ARCHITECTURAL ARTIFACTS
4 main artifacts that are used to shape up SOA
XML is used to define the data
SOAP is used to transfer the data
WSDL is used to define the service
UDDI is used to list the available services
Friday, March 23, 12
XML
• EXtensible Markup Language
• To transport and store data (unlike HTML, which is just to display the data)
• Created by W3C (World Wide Web Consortium)
Any idea what this comma separated stuff is?
123456 Mr, Mert, Caliskan, Ogretmenler Cad. No 6/A, , Cankaya, Ankara, 06300, Turkey
Friday, March 23, 12
XML
Decompose the data...
<order> <orderNo>123456</orderNo> <shipTo> <name>Mr Mert Caliskan</name> <address>Ogretmenler Cad. No 6/A, Cankaya, Ankara, 06300, Turkey</address> </shipTo></order>
Friday, March 23, 12
XMLmakes more sense now?
<order>! <orderNo>123456</orderNo>! <shipTo>! ! <name>! ! ! <title>Mr</title>! ! ! <firstName>Mert</firstName>! ! </name>! ! <address>! ! ! <addressLine1>Ogretmenler Cad. No 6/A</addressLine1>! ! ! <addressLine2></addressLine2>! ! ! <county>Cankaya</country>! ! ! <city>Ankara</zip>! ! ! <zip>06500</zip>! ! ! <country>Turkey</country>! ! </address>! </shipTo></order>
Cool but it got more gibberish than before?
how do we validate this bulk load of string?
Friday, March 23, 12
XSD
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://rubiconred.com/obay/xsd/common" targetNamespace="http://rubiconred.com/obay/xsd/common" elementFormDefault="qualified or unqualified"> <xsd:element name="address" type="tAddress"/> <xsd:complexType name="tAddress"> <xsd:sequence> <xsd:element name="addressLine1" type="xsd:string"/> <xsd:element name="addressLine2" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:string"/> <xsd:element name="country" type="xsd:string"/> </xsd:sequence> </xsd:complexType></xsd:schema>
• XML Schema Daefinition
Friday, March 23, 12
SOAP
• Simple Object Access Protocol
• Cross platform (platform independent) remote calls (usually over HTTP) with XML messages
• Could be done also with SMTP (a.k.a. emailing)
Envelope
Header Body
Content Fault
optionalrequired(one or more)
Friday, March 23, 12
WSDL
• Web Service Definition Language / XML Based
• Describes the Point of Contact for Service Provider
• Defines Structure of messages Physical location of service
• No need to generate the WSDL, server is doing that for us...
Friday, March 23, 12
What Does WSDL Look Like?<definitions name="EndorsementSearch" targetNamespace="http://namespaces.snowboard-info.com" xmlns:es="http://www.snowboard-info.com/EndorsementSearch.wsdl" xmlns:esxsd="http://schemas.snowboard-info.com/EndorsementSearch.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<!-- omitted types section with content model schema info --> <message name="GetEndorsingBoarderRequest"> <part name="body" element="esxsd:GetEndorsingBoarder"/> </message>
<message name="GetEndorsingBoarderResponse"> <part name="body" element="esxsd:GetEndorsingBoarderResponse"/> </message>
<portType name="GetEndorsingBoarderPortType"> <operation name="GetEndorsingBoarder"> <input message="es:GetEndorsingBoarderRequest"/> <output message="es:GetEndorsingBoarderResponse"/> <fault message="es:GetEndorsingBoarderFault"/> </operation> </portType>
<binding name="EndorsementSearchSoapBinding" type="es:GetEndorsingBoarderPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetEndorsingBoarder"> <soap:operation soapAction="http://www.snowboard-info.com/EndorsementSearch"/> <input> <soap:body use="literal" namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/> </input> <output> <soap:body use="literal" namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/> </output> <fault> <soap:body use="literal" namespace="http://schemas.snowboard-info.com/EndorsementSearch.xsd"/> </fault> </operation> </binding>
<service name="EndorsementSearchService"> <documentation>snowboarding-info.com Endorsement Service</documentation> <port name="GetEndorsingBoarderPort" binding="es:EndorsementSearchSoapBinding"> <soap:address location="http://www.snowboard-info.com/EndorsementSearch"/> </port> </service></definitions>
Your Eyes Hurt, aren’t they?
Friday, March 23, 12
What Does WSDL Look Like?
Service Description
Type Message PortType Binding Service
PortOperation
relates with
contains input and output message
knows its
Endpoint
optionalrequired(one or more)
Friday, March 23, 12
ReST
• via HTTP Methods GET / PUT / POST / DELETE
RepresentationaleState Transfer
• Resource: Any "Thing", Anything you would want to point to.
• Representation: Serializable description of resourcecould be images (jpg, png), XML or JSON data
• Resource Identification through URI
Friday, March 23, 12
ReST Example
Requirement: Give me the employee with id: 1234
Old School WS Method Invocation:
Cool ReST way:
Employee employeeWS.getEmployee(Long id)
GET /myApp/employees/1234 HTTP/1.1
Friday, March 23, 12
ReST ExampleResponse in JSON:
{ "employee": { "id": "481", "name": "Mert", "lastname": "Caliskan", "roles": [ "SOA Architect", "Lazy Developer", "Coding Monkey" ]}
Friday, March 23, 12
ReST... Final Words...
ReST is handy, simple to integrate with.
But,
Not solving real world problems like Security, Transactions and etc. (WS-* are still in need)
Documentation is still needed for resources, representations... (no WSDL remember?)
Fact: Everything we do over HTTP is "ReST"...!
Friday, March 23, 12
ReST is just CRUD
• You can expose your DB on WEB :)
• Simple & Stupid...
HTTP SQL CRUD
POST INSERT Create
GET SELECT Read
PUT UPDATE Update
DELETE DELETE Delete
Friday, March 23, 12
Public WS and ReST to play aroundhttp://www.service-repository.com
Weather Services
Google Questions
Movies and many more...
For ReST, check out:
Friday, March 23, 12
Create WS with Annotations
• @WebService()Marks a Java class as implementing a Web Service.
• @WebMethod(operationName = "add")Customizes a method that is exposed as a Web Service operation.
• @WebParam(name = "type")Customizes the parameters of the Operation.
Friday, March 23, 12
DEMO
• Let’s create a couple of Services with
JAX-WS (SOAP based) &
JAX-RS (REST based)
• JAX-WS
• JAX-RS } Reference Implementations
Friday, March 23, 12
WEB SERVICES
• Functionality packaged as a single unit exposed to network
• WSDL (Web Service Definition Language) / XML based
• WSDL 1.1 and WSDL 2.0 versions
Service Registry
Service Requestor
Service Producer
Find Publish
Bind + InvokeFriday, March 23, 12
many vendors out there,
so standardization needs to be done..!
Friday, March 23, 12
THE WS-* STANDARDSWS-Addressing
WS-AtomicTransactionWS-BPEL
WS-BaseFaultsWS-BaseNotification
WS-BrokeredNotificationWS-BusinessActivity
WS-CAFWS-CDLWS-CF
WS-ChoreographyWS-Context
WS-CoordinationWS-Discovery
WS-EnumerationWS-Eventing
WS-FederationWS-Federation Active Requestor ProfileWS-Federation Passive Requestor Profile
WS-FragmentWS-Inspection
WS-MakeConnectionWS-Management
WS-Management CatalogWS-MetadataExchange
WS-NotificationWS-Policy
WS-PolicyAssertionsWS-PolicyAttachment
WS-Provisioning WS-RM Policy Assertion
WS-ReliabilityWS-ReliableMessaging
WS-ResourceWS-Resource Framework (WSRF)
WS-ResourceLifetimeWS-ResourcePropertiesWS-ResourceTransfer
WS-SecureConversationWS-Security
WS-SecurityPolicyWS-ServiceGroup
Friday, March 23, 12
THE STANDARDS
48
WS-AddressingWS-AtomicTransaction
WS-BPELWS-BaseFaults
WS-BaseNotificationWS-BrokeredNotification
WS-BusinessActivityWS-CAFWS-CDLWS-CF
WS-ChoreographyWS-Context
WS-CoordinationWS-Discovery
WS-EnumerationWS-Eventing
WS-FederationWS-Federation Active Requestor ProfileWS-Federation Passive Requestor Profile
WS-FragmentWS-Inspection
WS-MakeConnectionWS-Management
WS-Management CatalogWS-MetadataExchange
WS-NotificationWS-Policy
WS-PolicyAssertionsWS-PolicyAttachment
WS-Provisioning WS-RM Policy Assertion
WS-ReliabilityWS-ReliableMessaging
WS-ResourceWS-Resource Framework (WSRF)
WS-ResourceLifetimeWS-ResourcePropertiesWS-ResourceTransfer
WS-SecureConversationWS-Security
WS-SecurityPolicyWS-ServiceGroup
Friday, March 23, 12
UDDI
• Universal Discovery and Directory Interface
• Started in early 2000s
• XML based Service Discovery Protocol
• Think of it as yellow pages
• Included in the WS-I standard
• Not widely adopted as hoped, Microsoft removed it from Windows Server OS.
• OSS implementation: juddi.apache.org
Friday, March 23, 12
Career in JAVA• Participate in Open Source
Be a Contributor / or better, be a Committer
• Learn the Language from inside out...
• Oracle Certifications are one way to go
Java SE 7 ProgrammerJava EE6 Web Component Developer
Java EE6 Enterprise JavaBeans DeveloperJava EE6 Java Persistence API Developer
Java EE6 Web Services DeveloperJava EE 5 Enterprise Architect
Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
If you know .NET, go ahead and learn Java. If you know Java move to Objective-C, Scala & etc.
Know broad... Know deep...
Know you stuff very well...Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
Stay Current... Use your knowledge...
Practice... Practice... Practice...
Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
Be Open-Minded...
Listen to people’s thoughts.. They’re more valuable than you think.. You CANNOT know everything..!
Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
Reject the status quo...
Don’t be a rebellion but don’t kill the rebellion inside you...
Friday, March 23, 12
Communication
CreativityProfessionalism
Experience
To be a Leader
Knowledge
Take and accept the responsibility...
Make it all in a classy way...
Friday, March 23, 12
Resume Preparation
• People skim resumes... So makeit to the point as much as possible
• It’s not what you know. It’s what you’ve done with what you know...
• Keep it short1 to 3 sentences, 1 to 3 pages at most
Friday, March 23, 12
To sum up on career...
• You are the one that will be building your OWN career.
• Work for your employer and work for yourself also...
• Take the time to build your skills:your knowledge, your communication skills, your experience
• And don’t kill the child inside you, make it creative as always...
• Act Professional, because you have to be a ONE..!
Friday, March 23, 12
To sum up...
• JAVA is still HOT TOPIC...
• Oracle is investing on Java so best is yet to come.
• SOA is not a hype anymore, big vendors are taking parts in the market with cool tools..
• Take a leap, dive into Java, build your career on it.
Friday, March 23, 12