[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-1154 - Introduce ability to mark nodes as reside

genman do-not-reply at jboss.com
Fri Sep 28 16:10:07 EDT 2007


"mircea.markus" wrote : anonymous wrote : and reduces node memory size (no need to add new boolean variables) - an boolean is hold on a bit. An RegularEnumSet aggregates an long (64 bit) + some caching arrays (other bits as well). From a memory POV it is optimal to aggregate booleans directly (than EnumSets wrapping enums). 
  | 
  | anonymous wrote : Reduces future changes of the Node interface (no need to add methods for a new feature) - code would be less readable; also I don't think this is an proper enum usage: i.e. define bounded types(the boolean variables are not logically related) -> enhance readability  

I still don't know why my concept hasn't caught on.

I saw your latest patches, which add flags to the data map. Then, you wrote a bunch of code to clean up the data as seen by the client. Sure, the external interface is clean but:

1. The internal code looks like crap. I don't know why you didn't opt for a boolean flag like everything else, but so be it.

2. You added new methods to an interface that's potentially designed for clients to implement. Or, is this interface supposed to get 2 new methods every point release? Adrian Brock "yelled" at me for doing something like this on a fairly obscure internal interface, and I don't and didn't work for JBoss. Hasn't he knocked a few times wondering what's going on?

3. You add methods to a general interface that are specific to a non-general concern.

The point is, sure you can have "boolean get/set" methods. But why not add to the interface instead:

  | void setProperty(Property p);
  | boolean getProperty(Property p);
  | 
The properties themselves could be an enum or Object with an ordinal (so users could register their own). You could conceivably implement the internals as an integer or series of booleans or EnumSet, or what have you. Then, when a bug fix or something arises in the future, you minimize change scope.

I just get the sense things are going to continue to degenerate until maybe 3.0 when you guys get a clue and fix the APIs again.

The main point was never to "aggregate booleans", it would just have been a nice side-effect. Saving memory is certainly nice, but next time I won't bring it up since it seems to just confuse people.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089852#4089852

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089852



More information about the jboss-dev-forums mailing list