Title: Technology Choices to Make Before Developing Your First J2EE Application
1Technology Choices to Make Before Developing Your
First J2EE Application
- Toon Koppelaars
- Centraal Boekhuis
- Netherlands
2My Mission This Week
- Technology choices to make before starting J2EE
project - A DB-Centric approach to J2EE application
development - Business Rules Specification, Classification,
Implementation
Application Development Is Moving In The Wrong
Direction
3Contents
- J2EE MVC
- Different Types of Applications
- Your Technology Choices
- Conclusion
4J2EE
SQL PL/SQL in Database
Java in App Container
EJB
EJB
EJB
JavaScript in Browser
Application server
Java
Java in JVM in OS
J
Servlet
Java in Web Container
D
Servlet
Applet
B
Java in JVM in Browser
JSP
HTML
JSP
C
RDBMS
Browser
Web server
Middle Tier
Data Tier
Client Tier
5J2EE
Pick your Architecture
6Browser
HTML from a Servlet
Application server
Apache
File System
OC4J
Html pages
Class files
Other Components
Other Components
JVM
jdbc
Database server
7MVC
- Popular Design Pattern Separate code into 3
parts - Model handling business logic
- Data retrieval manipulation
- Including checking involved Business Rules
- View creating user interface (UI)
- Front-end generation html/xml in browser
- The LOOK of the application
- Control dealing with UI events ? page flow
control - Triggered by user using the UI
- The FEEL of the application
8Browser
1
Application server
Apache
File System
OC4J
JSP files
Class files
Other Components
Other Components
JVM
jdbc
Database server
9Browser
1
Application server
Apache
File System
Control
OC4J
View
JSP files
Class files
Model
Other Components
Other Components
JVM
jdbc
Database server
10Different MVC Approaches
Fat Lots of code in this tier Thin Not so
much code in this tier
11Thin / Fat / Thin
12Thin / Fat / Thin
- Html based applic. the J2EE way
- Thin ? html with little JavaScript
- Fat ? all business logic
- Thin ? no PL/SQL, no views,
13Fat / Fat / Thin
Single table query PK-based DML
M
Model-FW EJB
VC
Applet, Swing
Client Middle Data
14Fat / Fat / Thin
- Rich GUI (client/server) the J2EE way
- Fat ? rich GUI, applet or Java in OS
- Fat ? all business logic
- Thin ? no PL/SQL, no views,
15Fat / Thin / Thin
Single table query PK-based DML
JDBC Model-FW
MVC
Client Middle Data
16Fat / Thin / Thin
- Client/Server early days (pre Oracle7)
- Fat-fat ? including all business logic
- Thin ? middle tier not used
- Thin ? No PL/SQL, etc.
17Fat / Thin / Fat
Multi table query Complex DML (updateable)
Views Triggers Stored PL/SQL
M
JDBC Model-FW
VC
Client Middle Data
18Fat / Thin / Fat
- Client/Server the right way (cw FFT)
- Fat ? rich GUI
- Thin ? middle tier not used
- Fat ? lots of business logic in PL/SQL
19Thin / Fat / Fat
M
Multi table query Complex DML (updateable)
Views Triggers Stored PL/SQL
Model-FW EJB
M
C
Struts
V
JSP UIX
Client Middle Data
20Thin / Fat / Fat
- Best of both worlds?
- Thin ? html frontend
- Fat ? some business logic in middle tier
- Fat ? some business logic in data tier
21Thin / Fat / Fat
- Best of both worlds ? there is a trap!
- How do we divide the business logic?
- Set rules, or else expect software that is hard
to maintain
22Thin / Thin / Fat
Multi table query Complex DML (updateable)
Views Triggers Stored PL/SQL
JDBC Model-FW
M
C
Struts
V
JSP UIX
Client Middle Data
23Thin / Thin / Fat
- My personal favorite
- Thin ? html frontend
- Thin ? KISS no Java if could be PL/SQL
- Fat ? full use of our mature RDBMS
24Fat / Fat / Fat
Multi table query Complex DML (updateable)
Views Triggers Stored PL/SQL
M
M
Model-FW EJB
MVC
Client Middle Data
25Fat / Fat / Fat
- Run, Run, Run!
- Fat client including business logic
- Fat middle tier
- Fat data tier
26Contents
- J2EE MVC
- Different Types of Applications
- Your Technology Choices
- Conclusion
27ADF Your Choices Within MVC
- By the time you know how fat and thin
- Here is your second choice
- What technology will you use?
- For Model
- For View
- For Control
28ADF
29Two ways to Rome
- You invest lots of time
- And make educated technology choices
- You consult people you trust
- And have them convince you of their preferred
technology choices - You drag drop with ADF
- yeah rightjust kidding
30Model Choices
- Would you like bottom-up or mid-down?
- windows on data application
- BC4J
- Build database access from the tables up
- If you really must go OO or UML
- EJB or just Java class hiearchy Toplink
- Build data persistence from object-model down
31View Choices
- What do you already know?
- Thin
- Nothing ? Go UIX
- Something ? Use that (probably JSP)
- Fat
- Nothing ? go WebForms
- Remains committed technology by Oracle
- Something ? Use that (Swing, AWT, )
- In near future
- Java Server Faces (next release of UIX)
32Control Choices
- This one is easy
- Struts
- Maybe in near future
- Oracles ADF-Controller
- You could even build your own
33Choices within Choices
- As mentioned earlier
- You can play around with Model-code
- IF you chose bottom-up!
- For instance BC4J
- All business rules in BC4J?
- All business rules in PL/SQL?
- Attend my thursday presentation
34Conclusion
- Choices to make, in order
- What type of application?
- What type of development approach?
- And then what technology?
- Our choices ? traditional approach
- If Thin client then,
- M/V/C BC4J / UIX / ltour owngt
- In a DB-Centric way
- If Fat client then,
- Traditional Client/Server technology ? WebForms
35Conclusion
- Take time to proof your choices
- Build a small toy application before you start on
the real thing - The M of MVC
- If you use both Java and PL/SQL
- Do your programmers know when to do what where?
- Set rules in this area
36t.koppelaars_at_inter.nl.net t.koppelaars_at_centraal.bo
ekhuis.nl
37(No Transcript)
38The New Belief
- Thou shall model thou business (logic) in an
OO-way and UML is thou vehicle to do this - Your BL-Code is the centre of the universe
instead of your persistent data - Your BL-Code will not end up in PL/SQL.
39Open Source
- Its for free!
- Application servers
- Integrated development environments
- Database management systems
- My view
- Developer productivity and maintenance cost are
the drivers - Not license costs
40Open Source
- Does your SW-architecture enforce
- Rich use of PL/SQL?
- Are you not afraid to
- Use Oracle frameworks for productivity?
- Just one EAR-file, or
- Multiple applications, single-sign-on, portal,
Webforms