[CompStrm Wiki] data proxies
Status: Beta
Brought to you by:
blaforge
From: Bill la F. <laf...@ya...> - 2006-05-10 03:48:48
|
Everyone, Here's a quick note on data proxies (below). Please let me know if this helps or not! Any feedback you have would be appreciated. Bill AgileWiki3 uses proxies for accessing data, the proxy object holding only the rid (rolon identifier), a 128 bit random number. But these are data proxies. The database holds only the data. These proxy objects implement the methods. Is this a break from object oriented programming? No more than object serialization where the pickled object identifies the class type. The difference here is that the data is not put in the proxy object. Rather it is cached. This gives us a big speed improvement. It also makes it easier to manage inverted data (indexes). By convention (not a requirement), the data proxy classes are in package org.agilewiki.ark.rolons. The base class is Rolon, and its a bit big. There is a descriptor entry, Type, which identifies the class of data proxy to be used. And in package org.agilewiki you will find a resource file, rolons.txt, which maps type names to data proxy class. Currently this table has 12 entries. Now every rolon has a descriptor unit rolon (a du) which also defines a kind of type, but this is a finer grained mapping--you can have multiple descriptor units which work with the same type of rolon. Every descriptor unit has a ledger entry, Type, which identifies the type of rolon that the descriptor unit works with. This is used when creating new rolons--you identify the descriptor unit to be used and use the DU's Type LEnt to determine the Type DEnt of the rolon being created. There are then only 3 steps to extending the object model: 1. Write a new data proxy class which extends org.agilewiki.ark.rolons.Rolon. This class must include, among other things, a static narrowing method. 2. Add a line to the rolons.txt file which gives the name of the new type of rolon and its class. 3. Create a DescriptorUnit rolon with a Type LEnt that names the new rolon type. __________________________________________________________ Yahoo! India Answers: Share what you know. Learn something new. http://in.answers.yahoo.com |