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 1
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 DSSA: Domain-Specific Software Architectures Components Software Component Architecture Frameworks Design Patterns Which Programming language? 2
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. 3
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 4
Vertical Framework: Portion of Application Generality Portion of Framework used 5
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: Java Application BC4J Database 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? 6
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 EO EO EO EO BC4J Database 7
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. 8
5. Existing Frameworks Examples of Existing Frameworks: Aranea InternetBeans Apache Express Cocoon JavaServerFaces Apache Struts Jerrata Backbone ATK - Jifty Achievo Karrigell ToolKit Mach-II Biscuit Maypole BinaryCloud Millstone BlueShoes OpenACS CakePHP OpenMocha Catalyst Ozone PHP Cocoon Framework Django PageKit ez publish PHP on TRAX Fusebox PRADO Helma Pylons Horde 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 9
o Seam o Spring o Stripes o Trails o InternetBeans Express 10
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 inmemory 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) 11
A complete list can be found in http://en.wikipedia.org/wiki/list_of_content_management_systems 8. Cocoon Framework 12
9. Summary Objectives Frameworks Classification Examples 13