Transcript
Page 1: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

1

Frameworks

1. Objectives ......................................................................................... 2

2. Frameworks....................................................................................... 3

3. Classification ..................................................................................... 3

4. Example: Components for Java (BC4J) ............................................. 6

5. Existing Frameworks ......................................................................... 9

6. Presistence Frameworks .................................................................. 11

7. Content Management System Frameworks ...................................... 11

8. Cocoon Framework ......................................................................... 12

9. Summary ......................................................................................... 13

Page 2: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

2

1. Objectives

A framework is not a library

Components in a library have little, if any, interaction with each

other (e.g., string, file, date, list).

Each component can be independently added to an application.

Building complex applications from scratch is very expensive.

Where are we in the software life cycle?

Requirements Design Implementation ….

Software

Architectures

Components

Software Component Architecture

DSSA: Domain-Specific Software

Architectures

Frameworks

Design Patterns

Which

Programming

language?

Page 3: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

3

2. Frameworks

There are no hard and fast rules as to what constitutes a framework.

In general, it should provide the skeleton of an application.

A framework is a partially complete (sub-) system that is intended to

be instantiated.

It defines the architecture for a family of (sub-) systems and provides

the basic building blocks to create them.

It also defines the places where adaptations for specific functionality

should be made.

In an object-oriented environment a framework consists of abstract

and concrete classes.

3. Classification

There are two categories of frameworks:

o Horizontal

o Vertical

Horizontal framework:

o It is a more general framework and can be applied in several

applications.

o Horizontal frameworks provide the most flexibility.

o Example: GUI toolkits, Master/detail coordination.

Vertical framework:

o It a more specific framework.

o It can only be applied to a specific application domain.

Page 4: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

4

o Example:

If you need to build an inventory control system, you might

find that a precooked inventory framework is a good way to

jump-start your development effort.

A statistical analysis framework for economic data can only

be applied to financial applications.

There are three variables that can distinguish a vertical framework

from a horizontal framework:

o The level of generality: The number of applications that can

potentially use features in the framework

o The average portion of the framework that is used per

application: The average utilization of the framework. For

example, x percent of classes in a framework are in a typical

application.

o The average portion of code in an application that is built from

the framework

Horizontal framework:

Portion of Application

Generality

Portion of Framework used

Page 5: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

5

Vertical Framework:

Portion of Application

Generality

Portion of Framework used

Page 6: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

6

4. Example: Components for Java (BC4J)

http://technet.oracle.com/tech/java/jroadmap/bc4j/listing.htm

What is BC4J?

o Oracle Business Components for Java (BC4J) is Oracle

JDeveloper's programming framework for building scalable,

multi-tier database applications from reusable business

components.

o It is a 100%-Java, XML-powered framework that enables

productive development, portable deployment, and flexible

customization of multitier.

o BC4J Architecture:

BC4J is the middle layer in a relational environment:

Why BC4J?

o Why would you connect to a database using JDBC?

o Why would you use java.sql.* or SQLJ to interact with the

database?

o Why would you create all the database tables manually?

Java Application

BC4J

Database

Page 7: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

7

Different Types of BC4J Components

o Application Module (AM)

Provides a logical container for view objects, view links, and

transactions

Takes care of database connections

Takes care of row locking

o Entity Object (EO)

Provides a wrapper for database structures

Create an EO for each table, view, or stored procedure

EOs contain Attributes, corresponding to columns or

procedure parameters

o View Object (VO)

Hide the complexity of the database from the application

Uses SQL query to specify filtered subsets of data from one

or more EO

VO Attributes correspond to EO Attributes

Provide cached, navigable, modifiable result sets

Provide runtime dynamic linking, sorting, and filtering

o Association

Defines the relationship between two entity objects.

o View Link

Defines the relationship between two view objects.

Java Application

VO VO … … VO VO

AM

BC4J

EO EO … … EO EO

Database

Page 8: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

8

A BC4J system

o An XML file, and possibly one or more JAVA files,

represents each BC4J component

o The XML file stores metadata while the Java file stores the

object's code that implements application-specific behavior.

o The following figure shows the relationship between different

components in the BC4J framework at the runtime.

Page 9: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

9

5. Existing Frameworks

Examples of Existing Frameworks:

Aranea

Apache

Cocoon

Apache Struts

ATK -

Achievo

ToolKit

Biscuit

BinaryCloud

BlueShoes

CakePHP

Catalyst

Cocoon

Django

eZ publish

Fusebox

Helma

Horde

InternetBeans

Express

JavaServerFaces

Jerrata Backbone

Jifty

Karrigell

Mach-II

Maypole

Millstone

OpenACS

OpenMocha

Ozone PHP

Framework

PageKit

PHP on TRAX

PRADO

Pylons

Quixote

Radicore

RIFE

Ruby on Rails

Seagull

Seam

Spring

Stripes

Symfony

Tapestry

Trailes

TurboGears

web.py

WebObjects

WebWork

Wicket

Zend

Zope

ZK

Java Web Application Frameworks

o Struts Action

o Struts Shale

o Java Server Faces

o WebWork

o Tapestry

o Wicket

o Cocoon

o RIFE

Page 10: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

10

o Seam

o Spring

o Stripes

o Trails

o InternetBeans Express

Page 11: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

11

6. Presistence Frameworks

Persistence Frameworks

o A persistence framework moves the program data in its most

natural form (in memory objects) to and from a permanent

data store the database.

o Persistence framework simplifies the development process.

o The persistence framework manages the database and the

mapping between the database and the objects.

o There are many persistence framework (both Open Source

and Commercial) in the market.

Examples:

o Hibernate - widely used open-source persistence framework

for Java.

o NHibernate for .Net languages

o iBatis - simple, uses SQL maps. Database schema not

transparent to Java code.

o Entity Enterprise JavaBeans - uses EJB container services to

perform persistence.

o Cayenne - Apache project, has GUI modeler that eliminates

need to write xml files. Can reverse engineer database or

generate database schema & Java code.

o TopLink (Oracle),

o Torque (Apache DB)

o The Apache Gora open source framework provides an in-

memory data model and persistence for big data

7. Content Management System Frameworks

Systems that store and manage content (centralized or decentralized)

Popular examples include: Joomla, Drupal, Apache Lenya (Based on

Cocoon)

Page 12: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

12

A complete list can be found in http://en.wikipedia.org/wiki/List_of_content_management_systems

8. Cocoon Framework

Page 13: Frameworks - seas.gwu.edubell/csci210/lectures/frameworks.pdf · Java Web Application Frameworks o Struts Action o Struts Shale o Java Server Faces o WebWork o Tapestry o Wicket o

13

9. Summary

Objectives

Frameworks

Classification

Examples


Recommended