Title: RE: [CFCDev] Cache design using decorators and factories - advice/criticism?
Scott,

Isn't the real issue when it comes to interfaces an external vs. internal issue? The issue is that interfaces are threatened by certain practices... and make the code less reusable? (NOTE: I AM TRYING TO GET THE CONCEPT... so the flamers guild can put down your torches.)

  • Does this violate code reuse
  • Is the code variable space protected (safe from accidental outside violation)
In most OS's the very OS isn't completely safe... so they end up witting extra code for doing things to prevent accidental conflicts and bugs. In caching this has the same potential... so you have one of two choices. You can write a completely protected caching method that will likely require a setting in the interface to persist correctly, or you will write a cache that is independent of the interface... which means since the object itself isn't persisting in all cases, it is still "possible" for something to write to that... therefore though it may be encapsulated... there is nothing to keep it from being corrupted. In other words... without it having a setting (not knowing about the outside world, but having the container give it a "guide" of where to persist) how do you make your objects persistent and encapsulated. (I have a technique I use... but there are scenarios that I have not encountered and would love to expand my use case model of objects.)

John

P.S.
A cake without sweetener isn't a cake. (heh) Try using "honey" in one cake... to make it make more sense. You will also find your cakes will turn out better with a bit of salt, oil or butter and a leavening agent are also needed. When you use an illustration... it helps to know something about it... so if you need help on the cooking side... I have been scratch cooking for years. Glad to help out. (ha, ha... couldn't resist... since it's true... and while we are at it... my wife and I teach a class in community education locally called "Healthy Deserts"... you guys are all welcome to come and take the class!)

[EMAIL PROTECTED] wrote:

Joe you made my head hurt then! Hehehe

So, in a nuthsell you have:

You have a series of objects that have their own specific methods (I'm trying not to break into an analogy here).

Then at runtime, based on the context of its use you need these ingredients (objects) to be merged together into one object to form

A perfect virtual object that has specific methods available (while same in naming but can also accepts different arguments). Sounds like an AOK use for the decorater or maybe even a case study for interface! Hehe

(ie analogy time)
I may bake a cake with eggs, flour, milk and no sugar
You may bake a cake with eggs, flour, water and sugar

Yet, the end consumer sees and uses the cake in the same way, only its ingredients underneath has changed?


The only downside I've even found with using decorator is (its hard to debug sometimes, you're methods can conflict with one another if your not careful, making a dynamic virtual object at runtime pieced together from others - just seems abnormal hehehe but it's an alternative approach to multiple inheritance.

Am I on the same page or another tangenet (think the later)?

Regards,

--------------------------------------------------

Scott Barnes
System Development Engineer

Goro Nickel Project
Level 8, 201 Charlotte Street
Brisbane QLD 4000
Email: [EMAIL PROTECTED]

Personal Blog: http://www.mossyblog.com


Reply via email to