Project description
The life cycle of software applications in general is very short and with extreme volatile
requirements. Within these conditions programmers need development tools and techniques with an
extreme level of productivity. We consider the code reuse as the most prominent approach to
solve that problem. Our proposal uses the advantages provided by the Aspect-Oriented
Programming (Kiczales et al, 1997)
in order to build a reusable framework capable to turn both
programmer and application oblivious as far as data persistence is concerned, thus avoiding the
need to write any line of code about that concern. Besides the benefits to productivity, the
software quality increases.
The objective of this project is to build a complete and totally reusable framework for
Orthogonal Persistence (Atkinson & Morrison, 1995) in concurrent environments with support for
transactions. The current version already is capable of freeing the programmer of implementing
any read or writes data operations. This prototype is supported by an object oriented database
and, in the future, will also use a relational database and have support for transactions.
Others projects (Atkinson et al, 1996)(Liskov et al, 1996)(Marquez et al, 2001)(Perez-Schofield et al, 2008) already have implemented Orthogonal
Persistence in the past. Some (Soares et al, 2002)(Rashid & Chitchyan, 2003) are Aspect-Oriented but require that the data object implement special
classes or interfaces.
System architecture
The framework architecture is organized as three main components/layers:
- Main module;
- Aspects;
- Database.
The former element provides an Application Programming Interface (API), as well as others important subsystems such as: object and
meta-object cache; the default instance adaptation mechanism; schema manager; database garbage collector; database weaver; and
database classloader.
The aspects are organized in two categories: application and framework.
The application level aspects provide applications with persistence and data integrity.
These application aspects, and the framework's API, are the "glue" that seamlessly attaches the framework to applications.
The framework concerns are modularized as five aspects: (1) instance adaptation; (2) database integrity;
(3) object storing; (4) system internal statistics; and (5) debugging.
Concerning to the instance adaptation aspect, in framework scope just the default behaviour is implemented.
This aspect can be extended with user-defined behaviour, which is reified as a special meta-object.
At the lowest level there is the object database. This database holds objects and meta-objets.
This framework prototype uses intensively the Java Reflection API to know the internal
structure of the object and it fields. This is crucial to for the object data hierarchy
drilldown until the object primitive data types. The prototype provides support to object
arrays. This particular type of object needs a specialized treatment since it must be
disaggregated in all individuals objects of one or more types. This procedure isn't need in an
object database, like the one used, it was an option made to achieve a normalized mechanism in
the object persistence aspect to enable a system future evolution to a relational databases,
and for cache performance issues allowing a granularity until the elementary object.
In order to the object persistence aspect distinguish between two objects, of a same class, to
know which one is persistent or is transient, that is done by a search on the system cache and
also on all related objects. An instantiated object that is referred in cache has an Object Id,
so it is long-lived. This solution avoids any preparation at type, code or object level
(Al-Mansari et al, 2007). By this way, the prototype meets the Persistence independence and
Type Orthogonality principles (Atkinson & Morrison, 1995).
The use of the framework it is very simple. The application objects source code it is needed
for the woven and compiling process.
To write an application, just add the framework package and start write code with any hurry
about persistence. To achieve final binary code, the process it is very simple and completely
automated by the IDE.
Demo
The following demo shows how the framework can be used. Just add the needed includes to an Aspect Project, in your favourite IDE, and start write
code without any hurry about persistence.
In this example, we demonstrate how simply is to create, update, delete and read object from the database in eight different programs (program01 to
program08). Those programs have dependences so you must run it sequentially.
The data objects are available on download.
Publications
Pereira R.H. & Perez-Schofield J. "Towards a flexible and transparent database evolution."
New Perspectives in Information Systems and Technologies, Volume 2, Advances in Intelligent Systems and Computing, vol. 276,
Rocha l, Correia AM, Tan FB, Stroetmann KA (eds.). Springer International Publishing, 2014; 23-33, doi:
10.1007/978-3-319-05948-8 3. URL http://dx.doi.org/10.1007/978-3-319-05948-8_3.
Pereira R.H. & Perez-Schofield J. "Evolution of the application and database with aspects."
16th International Conference on Enterprise Information Systems (ICEIS), 2014, doi:10.5220/0004966903080313.
URL http://dx.doi.org/10.5220/0004966903080313
Pereira R & Perez-Schofield J.
Database Evolution On An Orthogonal Persistent Programming System - A Semi-transparent Approach
In CISTI'2012 - 7ª Conferencia Ibérica de Sistemas y Tecnologías de Información, Madrid, 2012
Pereira R & Perez-Schofield J.
Orthogonal Persistence in Java supported by Aspect-Oriented Programming and Reflection
In CISTI'2011 - 6ª Conferencia Ibérica de Sistemas y Tecnologías de Información, Chaves, 2011
Pereira R & Perez-Schofield J.
An aspect-oriented framework for orthogonal persistence.
In CISTI'2010 - 5ª Conferencia Ibérica de Sistemas y Tecnologías de Información, Santiago de Compostela, 2010
Downloads
Contact me to get updated source code version.
News
- Aug/2014 - Support for transactions (Atomicity, Consistency and Durability) - Mechanisms of begin/commit/rollBack
- Apr/2014 - Our pointcut/advice constructs syntax was reorganized and enhanced
- Sep/2013 - A geographical application based in the OpenStreetMap database was developed. Its persistence is provided through AOF4OOP framework
- Sep/2013 - The framework's pointcut/advice expressions was enhanced in order to accommodate more complex schema evolution scenarios
- Aug/2013 - Several enhancements in object and meta-object cache subsystem, which had a significant impact in the overall system's performance
- Apr/2012 - AOP4OOP now supports transparently Schema Evolution
- Dec/2011 - The framework's code was rewritten in order to support the application schema through a meta-model in the database
- Jan/2011 - The source weaver was integrated in the framework as an Ant Task
The compilation and weaving process is being totally automated.
- Dec/2010 - Development of a new source weaver
Our last research focuses the study of a technique of overcome some limitations that we identified on the data type
abstraction and transparency in the previous version of the developed prototype. One of our goals was to avoid the Java
standard idiom for genericity, based on casts, type tests and subtyping. Moreover, we also find the need to introduce
some dynamic data type abilities. We consider that the Reflection is the solution to those issues. To achieve that, we
have extended our prototype with a new static weaver that preprocesses the application source code in order to introduce
changes to the normal behaviour of the Java compiler with a new generated reflective code.
- Sep/2010 - We are starting to work in new prototype features to enhance the data abstraction and transparency
- Feb/2010 - The first version is released
TODO
- ACID transactions - Isolation
- Improve the overall system's performance
- Support for relational databases with object Schema Evolution
References
Al-Mansari, M., Hanenberg, S. & Unland, R. (2007). Orthogonal persistence and AOP: a balancing act.,
In Proceedings of the 6th workshop on Aspects, components, and patterns for infrastructure software, 2.
Atkinson, M. & Morrison, R. (1995). Orthogonally persistent object systems. The VLDB Journal, 4, 319-402.
Atkinson, M. P., Daynès, L., Jordan, M. J., Printezis, T. & Spence, S. (1996). An orthogonally persistent Java. SIGMOD Rec., 25, 68-75.
Kiczales, J. G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J. & Irwin, J. (1997). Aspect-Oriented Programming. European Conference
on Object-Oriented Programming, 220-242.
Liskov, B., Adya, A., Castro, M., Ghemawat, S., Gruber, R., Maheshwari, U., Myers, A. C., Day, M. & Shrira, L. (1996). Safe and efficient sharing of
persistent objects in Thor. SIGMOD Rec., 25, 318-329.
Marquez, A., Blackburn, S., Mercer, G. & Zigman, J.N. (2001). Implementing Orthogonally Persistent Java., , 247-261.
Perez-Schofield, J. B. G., Rosello, E. G., Soler, F. O. & Cota, M.P. (2008). Visual Zero: A persistent and interactive object-oriented programming
environment. Journal of Visual Languages & Computing, 19, 380 - 398.
Rashid, A. & Chitchyan, R. (2003). Persistence as an aspect. In 2nd International Conference on Aspect-Oriented Software Development, 120-129.
Soares, S., Laureano, E. & Borba, P. (2002). Implementing distribution and persistence aspects with aspectJ. SIGPLAN Not., 37, 174-190.