Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Transparent Database backing?

I'm an experience Java programmer who has never used AsjectJ (or any other
aspect-oriented langage). The idea is intriguing and I was wondering whether
it would help me with a problem I am currently working oun.

I want to build a system in which certain Java objects are backed by a 
database.  I'd like to make it so that database references are an 
transparent as possible, so that objects exist in memory as stubs until 
such time as their fields are required, at which point they are loaded 
from the database. Later they may be garbage collected, written back into 
the database and removed from memory.

This isn't intrinsicly difficult, but I'd like to make it so that the process
was as transparent to the end programmer as possible. Ideally, I would 
like to allow them to forget that the objects were at all special and
just write them as normal, with something 'behind the scenes' loading and
saving them as necessary.

At first glance, it seems that AspectJ might allow me to do something 
like that. Can you add aspects to the reading and writing of fields? Would
it be possible to have an object which loaded fields from the database 
as they were read? How much could be hidden from the end developer?

Malcolm

-- 
Malcolm Ryan - malcolmr@xxxxxxxxxxxxxxx - http://malcolmr.web.cse.unsw.edu.au

     "Progress should mean that we are always changing the world to fit
      the vision, instead we are always changing the vision." 
               - G.K.Chesterton, Orthodoxy


Back to the top