61
ENTERPRISE JAVA & SOA Mert ÇALIŞKAN Doğu Akdeniz Üniversitesi 26.03.2012 Friday, March 23, 12

Enterprise Java and SOA

Embed Size (px)

DESCRIPTION

this slide deck gives a brief background on the history of java, lists the enterprise java frameworks, mentions the principles and elements of Service Oriented Architecture and finalizes the session by giving tips and clues on how to better shape up a career on java and ways to become a leader on software development.

Citation preview

Page 1: Enterprise Java and SOA

ENTERPRISE JAVA &

SOA

Mert ÇALIŞKAN

Doğu Akdeniz Üniversitesi

26.03.2012Friday, March 23, 12

Page 2: Enterprise Java and SOA

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

Page 3: Enterprise Java and SOA

TO JAVA ? OR NOT ?

Come to the Dark Side..!

Friday, March 23, 12

Page 4: Enterprise Java and SOA

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

Page 5: Enterprise Java and SOA

YOU KNOW THIS TRANS-ATLANTIC?

Friday, March 23, 12

Page 6: Enterprise Java and SOA

• 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

Page 7: Enterprise Java and SOA

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

Page 8: Enterprise Java and SOA

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

Page 9: Enterprise Java and SOA

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

Page 10: Enterprise Java and SOA

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

Page 11: Enterprise Java and SOA

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

Page 12: Enterprise Java and SOA

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

Page 13: Enterprise Java and SOA

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

Page 14: Enterprise Java and SOA

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

Page 15: Enterprise Java and SOA

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

Page 16: Enterprise Java and SOA

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

Page 17: Enterprise Java and SOA

THE STACK of VIEW

CONTROLLERMODEL

JSF

MYFACESORCHESTRA

JPAHIBERNATE

ENVERS

SPRINGH.VALIDATOR

H.SEARCH

MAVEN

ECLIPSE

with SecuRITY

Apache CXF

Friday, March 23, 12

Page 18: Enterprise Java and SOA

• 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

Page 19: Enterprise Java and SOA

Code walk-through with DEMO

Friday, March 23, 12

Page 20: Enterprise Java and SOA

SOAService Oriented Architecture

Not SOAP...!

Ok, maybe it is...

Friday, March 23, 12

Page 21: Enterprise Java and SOA

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

Page 22: Enterprise Java and SOA

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

Page 23: Enterprise Java and SOA

AIM OF SOA ?

• To INTEGRATE..!

• Services should interact, they must exchange information...

• Obey the ArchitecturalPrinciples...!

Friday, March 23, 12

Page 24: Enterprise Java and SOA

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

Page 25: Enterprise Java and SOA

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

Page 26: Enterprise Java and SOA

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

Page 27: Enterprise Java and SOA

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

Page 28: Enterprise Java and SOA

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

Page 29: Enterprise Java and SOA

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

Page 30: Enterprise Java and SOA

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

Page 31: Enterprise Java and SOA

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

Page 32: Enterprise Java and SOA

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

Page 33: Enterprise Java and SOA

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

Page 34: Enterprise Java and SOA

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

Page 35: Enterprise Java and SOA

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

Page 36: Enterprise Java and SOA

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

Page 37: Enterprise Java and SOA

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

Page 38: Enterprise Java and SOA

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

Page 39: Enterprise Java and SOA

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

Page 40: Enterprise Java and SOA

ReST ExampleResponse in JSON:

{    "employee": { "id": "481", "name": "Mert", "lastname": "Caliskan", "roles": [ "SOA Architect", "Lazy Developer", "Coding Monkey" ]}

Friday, March 23, 12

Page 41: Enterprise Java and SOA

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

Page 42: Enterprise Java and SOA

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

Page 43: Enterprise Java and SOA

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

Page 44: Enterprise Java and SOA

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

Page 45: Enterprise Java and SOA

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

Page 46: Enterprise Java and SOA

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

Page 47: Enterprise Java and SOA

many vendors out there,

so standardization needs to be done..!

Friday, March 23, 12

Page 48: Enterprise Java and SOA

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

Page 49: Enterprise Java and SOA

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

Page 50: Enterprise Java and SOA

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

Page 51: Enterprise Java and SOA

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

Page 52: Enterprise Java and SOA

Communication

CreativityProfessionalism

Experience

To be a Leader

Knowledge

Friday, March 23, 12

Page 53: Enterprise Java and SOA

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

Page 54: Enterprise Java and SOA

Communication

CreativityProfessionalism

Experience

To be a Leader

Knowledge

Stay Current... Use your knowledge...

Practice... Practice... Practice...

Friday, March 23, 12

Page 55: Enterprise Java and SOA

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

Page 56: Enterprise Java and SOA

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

Page 57: Enterprise Java and SOA

Communication

CreativityProfessionalism

Experience

To be a Leader

Knowledge

Take and accept the responsibility...

Make it all in a classy way...

Friday, March 23, 12

Page 58: Enterprise Java and SOA

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

Page 59: Enterprise Java and SOA

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

Page 60: Enterprise Java and SOA

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