[jboss-user] [JBoss Cache: Core Edition] - Re: Best use of Jboss Cache Implementation

manik.surtani@jboss.com do-not-reply at jboss.com
Tue Jul 22 05:47:30 EDT 2008


Yeah, there is no similar concept of "groups".

Fqn is basically a path in a tree structure.  JBoss Cache uses a tree as a data structure, and stores key/value pairs in nodes in the tree.

Simplistically, if you did not care about any optimisations around the tree structure, you could just create Fqns based on the yupe of data you are storing, sort of like namespaces.  E.g.,


  | cache.put("/org/mycompany/customerdata", "customer1", c1);
  | 

Now since all locking and replication happens on a per-node basis, you may optimise further to do something like:


  | cache.put("/org/mycompany/customerdata/customer1", "customer1", c1);
  | 

so that each node contains information pertaining to a single entity.

Regarding singletons, it is a valid pattern, only we don't implement it internally and prefer users to do this themselves based on their environment e.g., an IoC framework may have it's own mechanism of creating, maintaining and injecting singletons, a Java EE environment may use JNDI, or simplest of all, you may create a CacheSingleton class with a single static getInstance() method.

HTH,
Manik



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

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



More information about the jboss-user mailing list