[Registry-dev] Code clean up and Class renaming
Deepal Jayasinghe
deepal at wso2.com
Wed Sep 5 23:04:35 PDT 2007
Deepal Jayasinghe wrote:
>> While we were doing code cleanup we renamed Directory into
>> CollectionContent , previously Directory was extending from Resource
>> (Artifacts). However we found that we do not want Directory to extend
>> from Resource since directory is the content of the resource. Therefore
>> when we need to store directory in the registry we first create a
>> resource and set its content as directory.
>
> Sorry but I'm not at all convinced. Doesn't a directory have all the
> properties of a resource? Such as author, creation time etc.? So do
> you plan to copy those?
All the properties associate with the Artifact , so author last modified
and etc will be there in the Artifact. And Artifact will have content
which can be
- Collection or
- File content
>
>> So now we have CollectionContent inside the Artifact (Resource), and the
>> content on of the CollectionContent could either be a just content (a
>> file) or CollectionContent .
>
> ARGH. CollectionContent makes no sense. IIUC what you're saying is
> that you have a special property inside Artifact (the artist
> previously known as Resource [this was a James suggestion .. more on
> that later]) to store a list of paths, right?
It was there before we refactor , so we found that it is much cleaner
to have only the content property in the artifact . And there can be
different kind of content at the moment we have;
- Collection
- XML (WSDL , Scheam and ect)
And in the future we will have more , so the content type property in
the artifact will represent the exact type in the content object .
> In other words every Artifact has to know whether its a simple
> artifact or a collection.
>
> That's *exactly* where subclassing gives a better developer and user
> experience.
>
> I prefer to have
> class Artifact
> class Collection extends Artifact
>
> Sanjiva.
More information about the Registry-dev
mailing list