New Rolon objects
The refactoring is nearing a rough completion. Compiles are clean, but that's the best I can say for it. This was a huge refactoring of the Ark class.
I've wanted to separate base logic from descriptor logic and I've achieved that in a way that is typical for oo programming. The Rolon objects are dumb and stateless, being only wrappers for a reference to Ark and the TKS record id. Each user session will have its own copy as needed, so they are easily instantiated without any need for synchronization.
Descriptor-driven logic will remain in the Ark methods, Rolon objects serving only as a proxy for the persistant data.
What I've done then is remove a huge chunk of code from the Ark class and placed it in the Rolon class--about 75% of the code in fact. This is quite fine, as I expect the Ark code base to grow substantially as we add descriptor logic.
The other thing I've achieved is to put a friendly object face on Rolons, making the command, control (evaluator) and display logic easier for most folk to read and understand.
One of my goals in AgileWiki3 is to keep descriptor logic centralized, rather than scattered in command logic and various other places. My hope then is that the methods in Ark will be the only place where descriptors are processed.
So for example, a setLedgerEntry method on Rolon would simply set the value of a ledger entry. But a similar call on Ark would perform validation. I'm not entirely comfortable with this. An alternative would be to use a factory method on Ark for creating Rolons and use a subclass of Rolon to add smarts. For example, a createJSec method would instantiate a JSec subclass of Rolon that contains the JSec classifier access methods as well as descriptor logic relating to JSecs. But this sounds like a subsequent refactoring project. First I want to bring this one to a close. There's always room for subsequent improvements, though hopfully they will not be as substantial a change as this one!
Figure another day or so until I do the commit for this change.
Bill
0 Comments:
Post a Comment
<< Home