Sample Employee application case study

In this case study we will try to show benefits of vpda. We will introduce business case and describe steps needed to take in vpda comparing to development with 'traditional' techniques. We will consider similar architecture for vpda and non-vpda application using only java libraries,frameworks.

Case study

We want to develop sample application that can collects organization departments, its employees and realized projects. We have these domains in our application:

  • Department
  • Employee belonging to Department
  • Project realized by Department
  • Task executed by Employee

Really simply, multiuser application. We would suppose both application will have 3 tier architucture. Application will use relational database to store data, have application logic on server and presentation logic implememted as web or desktop application. We will start with database layer.

Database layer

Application is really simply, we can suppose we will need no stored procedures, just tables to store data.

  • Non-vpda application will need to create and manage database script (also for various target DBMS)
  • VPDA provides small modeling library to model database tables like java classes. This is very simply modeling using which we get DB vendor independence and compilation check when mapping to JPA entities. Look at usage to see example.
  • Both vpda,non-vpda can use JPA to persist data. Vpda adds transaction service regardless of server platform.

Application layer

In this tier we need to create services using which we can make basic CRUD operation upon domain objects and add advanced business logic. These services will be used mainly by view tier, but coul be used also as integration services with other systems. Typically these services should be realized like session beans.

  • Non-vpda application can create session beans to implement basic CRUD services. These services will operate directly with domain entities, so also caller of this layer must use domain objects. We will need JEE application server , which although provides many services , it is not so easy to develop application effective way.
  • VPDA will also use business services to implement basic CRUD operation, but this business services can run in J2SE using Spring or on application server . Application code is always same. So we can very quickly change application and run again in our favorite IDE without any special plugins or tools like (MyEclipse, Eclipse WTP, RAD).

Presentation layer

This tier somehow presents data and provides application flow. It can be implemented like web or desktop application. Here we will see power of vpda.

  • Non-vpda application can create web application and use JSP,JSF,Wicket,GWT or any web framework. For all of these framework it is not so easy to develop large, well maintainable application. For each 'frame' we need to define view (columns, detail fields, action) and provide communication with application layer. Imagine realy big application like ERP system, CRM with many developers, it is big challenge to develop such consistent and easily scallable tier. Web application will be deployed probably to web server and communicates with Application layer using EJB local or Remote calls.
  • Non-vpda can create desktop application using Swing or SWT. These means hard work to define all frames and actions and to 'map' user interface to appllication layer. This way client is also controller and there is always some very important bussiness logic ( like at least filtering, business validation) there. Also client must communicate with server using EJB remote calls, which means having vendor libraries on client.
  • VPDA divides presentation client between client and server machine. Client is always only presenter of data regardless it is swing client or web client. We do not write new client code for new application. We define client views and controller using view providers components on server. These components provides view and controller for client. So we develop one application with two client target platforms. We do not need to do hard work to define view and implement communication to server