ARB Stage 1 for
Download
Report
Transcript ARB Stage 1 for
Enterprise Architecture
Java / Java EE 101 Training
Awareness
M. Reha, Enterprise Architecture
2009-04-10, v0.1
Confidential and Proprietary
AAA NCNU © 2008, 2009
>
>
>
Agenda
Course #1:
•
Introduction to the Java Programming Language
•
“Hello World” Java class
Encapsulation, Inheritance, Interfaces
•
Course #2:
•
Introduction to the Java EE Platform
•
“Hello World” Java EE web application
Closing
•
•
Questions
References
2
Background on Java SE and Java EE
3
Introduction to the Java Programming Language
>
>
>
>
>
Java is a programming language originally developed by James
Gosling at Sun Microsystems and released in 1995 as a core
component of Sun Microsystems' Java platform.
The language derives much of its syntax from C and C++ but has
a simpler object model and fewer low-level facilities.
Java applications are typically compiled to bytecode that can run
on any Java virtual machine (JVM) regardless of computer
architecture.
The original and reference implementation Java compilers, virtual
machines, and class libraries were developed by Sun from 1995.
As of May 2007, in compliance with the specifications of the Java
Community Process, Sun made available most of their Java
technologies as free software under the GNU General Public
License.
4
History of the J2EE Platform
J2EE Platform:
•
•
•
•
•
•
Java Platform Edition JPE announced in May 1998
J2EE 1.2 released in December 1999 (peak of the .COM era)
J2EE 1.3 released in September 2001 (end of .COM era)
J2EE 1.4 released in November 2003
EE 5 released in May 2006
EE 6 scheduled release for the end of 2008 (approval of JCP specification)
Lots of enterprises are still on J2EE 1.3 from 2002!
The Portlet Specification was not released until October 2003.
5
J2EE Platform from post .COM era (2002-2004)
Client (mostly browser based)
Utilities and Core Services
Logging (Wrapper)
Tracing (Wrapper)
Exception Framework
Base Classes/Frameworks
Alert (like HP Open View)
Cache (Wrapper)
Static Data
Security/SSO
*
Web Application
Application Server
Governance
Standards, Best Practices/Guidelines
Architecture Review Boards etc.
Struts 1.x (MVC)
JSTL (Tag Library)
MyFaces/Sun JSF RI
Apache Commons (Utility)
Apache Log4j (Logging)
Hibernate(Persistence)
iBatis (Persistence)
iText (PDF)
POE (MS Docs)
Quartz (Timer Service)
Castor (XML Framework)
Apache Xerces/Xalan (XML)
Apache Axis (Web Services)
SSO
OSCache/EHCache (Cache)
*
Web
EJB
JSP
Servlet
Session
Entity
MDB
JCA
JTA
Mail
JMS
JAAS
JMX
JAXB
Integration/Middleware
Business Rule Engine
ETL
Messaging/MQ
FTP
Web Services
Proprietary Scripts etc.
Screen Scraping
*
J2SE 1.3 – 1.4
JNI
RMI
JNDI
JDBC
JavaBean
Java 3D
Java 2D
Swing
AWT
MVC
DAO
Command
Factory
Business Delegate
Business Façade
Decorator
Value Object
*
*
Open Source
J2EE 1.3 – 1.4
JAX-R
Design
Patterns
Containers and Services for UI, Business, Database
Security
Administration and Deployment
Value Add Services (Proprietary Frameworks etc.)
JAX-RPC
SDLC and Development Tools
XP, Scrum, RUP, Waterfall
Eclipse, IBM WSAD/RAD, NetBeans, JBuilder, IntelliJ
Code Analyzers (Checkstyle, FindBugs), Unit Test Frameworks (JUnit, TestNG)
UI: HTML, CSS/DHTML, JavaScript, AJAX, Applets, Flash
Application Logic, Business Logic, Data Access Logic
Enterprise Application Integration (EAI)
6
>
>
>
>
>
>
>
>
>
>
>
J2EE Platform Observations from 2002-2004
Leveraged lots of open source libraries to fill in the J2EE specification gaps (like Web MVC
Framework, XML, Web Services). Soon there would be competing and redundant technologies such
as XML, Web Services, Logging, etc.. The Enterprise and Application Architect definitely had their
work cut out for them. What technologies do we use?
Some J2EE specifications were of little value to the enterprise (for example, Entity Beans (CMP or
BMP) and Stateful EJB’s…..J2EE 1.2 only supported remote Session Beans!).
Enterprise Integration was tightly coupled and reuse of enterprise assets not fully thought out or
realized.
Application Servers often provided proprietary (and competing) technologies and frameworks
(Portlets, Web, Security, etc.).
Lots of programming models to learn.
Governance was often over looked causing lots of inconsistencies in architecture and duplication of
code/frameworks.
Most development methodologies were still very “water fall”. XP was just taking off.
Development Tools needed improving.
Generally there was very high TCO for 1st generation (MVC-1) and 2nd generation (MVC-2)
applications.
De-facto Standard Application Servers: WebLogic, WebSphere, and some Oracle.
Increasing frustration with J2EE standard (some of it was justified and some was not).
7
J2EE Web 1.5/2.0 Application Architecture (2005-present)
Client (not just browser based anymore)
Web Application
Open Source
Struts2 (MVC)
Apache Commons (Utility)
iBatis (Persistence)
iText (PDF)
POE (MS Docs)
Quartz (Timer Service)
Apache Axis (Web Services)
OSCache/EHCache (Cache)
*
Struts2 Framework
Presentation
Rails/Grails Framework
HTML, CSS, JavaScript, AJAX
JSF, SpringMVC, JSP, Servlets, JSTL
Facelets, Seam, Spring WebFlow
Business Rule Engine
GWT Framework
Utilities and Core
Services
Logging/Tracing (Wrapper)
Exception Framework
Base Classes/Frameworks
Alert (like HP Open View)
Cache (Wrapper)
Static Data
Security/SSO
*
Object Model
Application Domain Model
Business
POJO (via Spring or Session)
Message Driven Beans
Timer Beans
Web Services
SOA
EAI
ESB, BPM
WS-*
UDDI
WSDL
XML
JCA
ETL
JMS/MQ
Data Access
JDBC, SQL, SP
JPA/Hibernate/TopLink/iBatis
OLTP DB
J2EE Application Server (now some open source)
EE 5
J2SE 5
Spring
DI
AOP
SpringMVC
WebFlow
Security
Open JDK
Java, Ruby, Groovy, Python, Scala
8
Legacy Systems
And
Legacy DB
Or DW
>
>
>
>
>
>
>
>
>
Observations from 2005-2007
Move away from Struts 1.x or proprietary frameworks to newer web frameworks like JSF (plus
Facelets, Seam, and Ajax4Jsf) or Struts2 or SpringMVC (with WebFlow).
Move toward annotation based configuration (versus mass of XML configuration files).
Less Open Source required (due to maturity of EE specification, Spring, and open source application
servers like JBoss, Glassfish, Tomcat 5/6). Apache Foundation, Spring, Craig McClanahan (JSF),
Rod Johnson(String/EJB3), Gavin King(Hibernate/JPA) were really influencing and pushing the
Java/J2EE platform forward.
Spring getting lots of traction in the industry (dependency injection (simple but powerful!), POJO
based for simpler programming model, AOP (for security, transactions, tracing, etc), wrappers for
integration with EJB, WS, etc.).
NetBeans IDE is becoming a viable and powerful IDE (Eclipse finally has some competition). Eclipse
Foundation followed suite and also released Eclipse Europa. No need to buy a J2EE IDE now.
Rather then reinvent we must reuse in the Enterprise, move from vertical applications to Enterprise
wide applications => SOA and leverage full Web Service stack, ESB, BPM.
New EE web applications can be built much quicker and with much less code. My last project, using
JSF and Spring and iBatis, was built with 50% less code, delivered on time (actually over delivered
by adding more features requested from our customer), and was 25% under budget.
Google influence => Google Web Toolkit, Google Docs, Google Maps, etc.
Sun and Microsoft finally working together (WS-* in 2006) => that is a good thing for everybody!
9
Course #1 – Java SE 101
10
“Hello World” in the Java Programming Language
Name of Object
In Java == Object.java
or a Class
HelloWorld
Object
private
String
message;
Data
/ State
private Font font;
The Objects
internal data
or state
Behavior
public sayHello();
/ Operations
The Objects behavior or
operations
11
“Hello World” in the Java Programming Language
12
More “Hello World” in the Java Programming Language
Extends the behavior of
HelloWorld
HelloWorld
BaseHello
private String message;
public sayLoudHellIo();
public sayHello();
13
More “Hello World” in the Java Programming Language
14
Course #2 – Java EE 101
15
References
Anonymous. 2009. Wikipedia. Retrieved April 10, 2009
from http://www.wikipedia.com
16