struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David H. DeWolf" <>
Subject Re: [tiles2] ComponentDefinitions - exposed implementation detail?
Date Wed, 01 Nov 2006 01:38:08 GMT
By the way, Antonio, I've looked at multidimensions at a high level, and 
realize that you're providing a unique implementation of this interface. 
  I meant to mention that I believe that you could accomplish the same 
thing (if we were to perform the refactor suggested below), by providing 
a customized DefinitionsFactory (that probably extends the 
UrlDefinitions factory).

David H. DeWolf wrote:
> I'm wondering why the ComponentDefinitions interface has been exposed 
> outside of the DefinitionsFactory.  To me, this class seems like an 
> implementation detail of the factory itself, and it should not be exposed.
> Currently the interface is only used in three points outside of the 
> DefinitionsFactory (besides in tests):
> 1) TilesFilter - used for refreshing the component definitions
> 2) TilesUtilImpl - used to share the instance with the world
> 3) ComponentDefinition - used to resolve hierarchy
> I don't think any of these require the component definitions.  I'd like 
> to discuss refactoring them in the following manner:
> 1) Encapsulate the refresh logic in the DefinitionsFactory.  The filter 
> will change to:
> if(factory.refreshRequired()) {
>     // replace refresh logic with a call
>     // to the factory, removing the reference
>     // to ComponentDefinitions
>     factory.refresh();
> }
> 2) TilesUtilImpl only exposes the ComponentDefinitions in order to allow 
> the Filter (#1) to access them.  This reference can easily be removed.
> 3) Encapsulate the hierarchy resolution within the DefinitionsFactory, 
> allowing the resolution to occur during initialization.
> I believe that this refactor will remove some complexity and the 
> cyclical dependency which has been created between the 
> DefinitionsFactory and it's runtime environment.  IMHO, the 
> DefinitionsFactory should only be concerned with creating 
> ComponentDefinition objects, it should not need to know anything about 
> it's outside environment (see the current call to the Application Scope 
> map in order to re-retrieve the ComponentDefinitions).
> David

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message