The base for development of any web application is to understand the requirement, business logic and the data that needs to be accessed, maintained, built and processed.
In n-Tier Architecture which is a client server architecture, model, view and controller needs to be identified. The storing of the model usually happens in database Tier where the enterprise data resides. This data can consist of any source of information, including an enterprise Oracle, or any other enterprise database, a set of XML documents (data that has been conforming to the XML specification) or even a directory service like an LDAP server.
The data management in this tier typically includes storage and retrieval, as well as managing updates, allowing concurrent access by more than one middle tier process, providing security, ensuring the integrity of the data, providing data backup and so on. Usually if the data source is relational data source all of these are taken care of by RDBMS (Relational Database Management Systems).
This separation of data from business logic and presentation helps to keep data neutral and independent from application server and scaling and performing CRUD (Create, Read, Update, Delete) functionalities is more sensible.
Technologies that are supporting store and retrieve of persistent data are JDBC, ORM, ODB, EJB 2, JPA. The following table shows the persistence mechanisms and what important feature each of them supports or not:
Supports: | Serialization | JDBC | ORM | ODB | EJB3 | JDO | JPA |
Java Objects |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Advanced OO concepts |
Yes |
No |
Yes |
Yes |
No |
Yes |
Yes |
Transactional Integrity |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Concurrency |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Large Data sets |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Existing Schema |
No |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Relational and Non-Relational stores |
No |
No |
No |
No |
Yes |
Yes |
No |
Queries |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Strict Standard / Portability |
Yes |
No |
No |
No |
Yes |
Yes |
Yes |
Simplicity |
Yes |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
What does serialization mean? It is a built-in mechanism in core Java Libraries for writing a graph objects into a stream of data. The stream of data then can be programmatically manipulated.
I am going to provide a very brief introduction of each APIs:
JDBC (Java Database Connectivity) is one of the most well known among all Java community. JDBC is to manipulate persistent data in relational database. It has a good serialization mechanism, it can handle large data, ensure data integrity.
ORM (Object-Relational Mapping) can perform mapping between objects and relational database for you and there are several frameworks like hibernate. The drawback is each of these frameworks has their own API, therefore your code tied to the proprietary interfaces of a single vendor. These days many companies are using ORM for their persistence mechanism.
ODB (Object Databases) are much easier to use, is not that popular. It store objects rather than mapping it.
EJB3 (Enterprise Java Beans) using entity enterprise beans to access database. Few years back was very popular as J2EE emerged but as it is very expensive and hard to maintain.
Here is a little flow diagram of how the requests get to the database in EJB3.
JDO (Java Data Objects) is a specification of Java Object persistence. JDO objects are plain POJOs and it is developed by Apache JDO project. Object persistence is defined in the external XML metafile. JDO advantage over JPA is it also supports non-relational databases.
JPA has the best ideas from existing persistence technologies. It is simpler programming model for entity persistence, in a way it is as easy as creating a serilalizable classes. JPA avoids vendor lock-in by relying on a strict specification. It focuses on relational databases. It allows POJO to be easily persisted without requiring the classes to implement any interfaces or methods. JPA defines a runtime EntityManager API for processing queries and transaction on the object against the dataset. That is why JPA is one of the best.
My coder is trying to convince me to move to .
net from PHP. I have always disliked the idea because of the expenses.
But he’s tryiong none the less. I’ve been using WordPress on numerous websites for about a year and am worried about switching to another platform.
I have heard excellent things about blogengine.net. Is there a way I can import all
my wordpress posts into it? Any kind of help
would be really appreciated!