[Yanel-development] Re: [Yanel-commits] rev 20491 - public/yanel/branches

Josias Thöny josias.thoeny at wyona.com
Fri Dec 1 14:25:53 CET 2006


Hi Michi,

On Fri, 2006-12-01 at 13:11 +0100, Michael Wechner wrote:
> Just being curious, but what kind experiments and refactorings do you 
> have in mind?

I'm thinking about making the api a bit easier to use, and about
refactoring a few things concerning the path mapping (url <-> path <->
repo), and how resources access the repository and the RTIs.
In fact I already implemented some of my ideas and committed them right
now in the sandbox branch. I thought it will make it easier to talk
about it if there is some code at hand.

I'd appreciate if you and the other devs could have a look at it and
tell me what they think about it. In case people like it, we could
eventually merge the changes back into the trunk.

What I changed is the following:

- Mapping between url and path is now done by the Map class.
  (Before it was done in an implicit way which was not very
  clear to me)
  Now it uses the realm configuration (realms.xml) instead of
  the repository to do the mapping from an url to a realm.
  
- Resource instances are now bound to their realm and path:
  When a resource is created, the realm and the path are 
  passed to the resource, and the resource has methods
  getPath() and getRealm().
  The path is relative to the realm, e.g.:
  url: /yanel-website/foo/bar.html
  realm: yanel-website
  path: /foo/bar.html
  This change required to add new interfaces ModifieableV3 and
  ViewableV3.

- Added abstraction of rti file: ResourceTypeIdentifier.java
  This class reads an rti file and provides methods to access
  the rt identifier string and the properties (similar to a
  java.util.Map)
  Resource instances can do getRTI().getProperty("myproperty")
  to access a property

- The repositories are now associated with the realms:
  Each realm has a default repository and an rti repository.
  A resource may access the default repository like this:
  getRealm().getRepository().getInputStream(path);
  (no need to use YarepUtil anymore)
  (note that a resource is not forced to use this repository)

- Added ResourceManager.java and moved some methods to this
  class to create resources and 
  access the RTIs.


Most of my changes are just about restructuring, i.e. I didn't add or
remove much functionality (apart from the ResourceTypeIdentifier class).
I tagged quite a few methods as deprecated.

Since I changed quite a lot, a few things are not working atm, e.g the
atom resource. 
The only resources I updated to the new interfaces so far are the
XMLResource and the FileResource. 
However I believe that those things which are currently broken could be
fixed rather easily. 

I tried hard not to impair the flexibility or other ideas behind yanel,
but it might be that I have missed something.

Looking forward to your feedback...

Josias


> 
> Cheers
> 
> Michi
> 
> josias at wyona.com wrote:
> 
> >Author: josias
> >Date: 2006-12-01 12:00:33 +0100 (Fri, 01 Dec 2006)
> >New Revision: 20491
> >
> >Added:
> >   public/yanel/branches/sandbox/
> >Log:
> >added sandbox branch to allow experiments and refactorings.
> >
> >
> >Copied: public/yanel/branches/sandbox (from rev 20490, public/yanel/trunk)
> >
> >
> >_______________________________________________
> >Yanel-commits mailing list
> >Yanel-commits at wyona.com
> >http://wyona.com/cgi-bin/mailman/listinfo/yanel-commits
> >
> >  
> >
> 
> 




More information about the Yanel-development mailing list