[jboss-jira] [JBoss JIRA] Created: (JBCACHE-911) Remove or refactor NodeFactory
Elias Ross (JIRA)
jira-events at jboss.com
Tue Dec 19 18:29:37 EST 2006
Remove or refactor NodeFactory
------------------------------
Key: JBCACHE-911
URL: http://jira.jboss.com/jira/browse/JBCACHE-911
Project: JBoss Cache
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Elias Ross
Assigned To: Manik Surtani
I don't see any external use for this class in 2.0 and think it's quite ugly. There is no way to configure the behavior. Users shouldn't use it anyway.
Places it is called:
* NodeImpl.getOrCreateChild() -> I'm thinking that adding a "template method" to say AbstractNode
protected abstract Node createNode(Fqn child_fqn, Node parent, TreeCache x);
would be good. OptimisticNode or WorkspaceNode can obviously override this.
* TreeCache {}: Since it's configuration driven, map an "enum" to a series of "new NodeXYZ()" statements.
* OptimisticXYZInterceptor : Create factory methods in TransactionWorkspace
* DefaultStateTransferIntegrator : ??
Node target = factory.createDataNode(nodeType, name, fqn, parent, nd.getAttributes(), false, null, cache.getCacheSPI());
((DataNode) parent).addChild(name, target);
Should simply be able to call parent.addChild(name) here. There is the (small) optimization of reusing the attribute Map directly, but this is probably a premature optimization. Or, maybe just parent.put(name, nd.getAttributes()) ?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list