You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by Nicholas L Gallardo <nl...@us.ibm.com> on 2009/06/30 17:00:41 UTC

understanding the metadata tree


Before making any changes (WINK-10), I want to make sure I understand some
of the semantics of the code correctly.

org.apache.wink.common.internal.registry.metadata.ClassMetadata   --  This
is meant to model ANY class that would be used in a JAX-RS application
(root resource, sub resource, provider, etc.).  It is THE ultimate holder
of generic information on what needs to be injected and how to create
instances of the class.  Is that correct?

org.apache.wink.common.internal.registry.metadta.*Collector  --  These
classes are responsible for building the metadata instances.

org.apache.wink.server.internal.registry.*Record  --  These objects are
created as root resource and provider instances are added to the config.
They are added to the registry which represents the config for the entire
set of resources available in the application.


I like the breakdown/organization of those parts.  Just trying to make sure
the semantics are clear.

So, as a general prinicple, if we're going to affect how things are
represented to the runtime, getting the information we need in one of the
Collectors should be the first choice.  The ClassMetadata instances are
immutable once they've been added to the config, correct?


-Nick




Nicholas Gallardo
WebSphere  - REST & WebServices Development
nlgallar@us.ibm.com
Phone: 512-286-6258
Building: 903 / 5G-016

Re: understanding the metadata tree

Posted by Michael Elman <ta...@gmail.com>.
>
>
>
> Before making any changes (WINK-10), I want to make sure I understand some
> of the semantics of the code correctly.
>
> org.apache.wink.common.internal.registry.metadata.ClassMetadata   --  This
> is meant to model ANY class that would be used in a JAX-RS application
> (root resource, sub resource, provider, etc.).  It is THE ultimate holder
> of generic information on what needs to be injected and how to create
> instances of the class.  Is that correct?
>

Correct. Just one clarification: ClassMetadata contains ConstructorMetadata
that contains the information how to create the class (which constructor to
use and what are the parameters to inject), but it doesn't define the life
cycle of the object. Meaning, it's not enough to look at the ClassMetadata
in order to know how exactly the object will be created.


> org.apache.wink.common.internal.registry.metadta.*Collector  --  These
> classes are responsible for building the metadata instances.
>

Correct.


> org.apache.wink.server.internal.registry.*Record  --  These objects are
> created as root resource and provider instances are added to the config.
> They are added to the registry which represents the config for the entire
> set of resources available in the application.
>

Almost correct: The *Record classes are used only for resources
(root-resources, sub-resource locators, sub-resource methods and so on).
They are NOT used by the providers.


>
>
> I like the breakdown/organization of those parts.  Just trying to make sure
> the semantics are clear.
>
> So, as a general prinicple, if we're going to affect how things are
> represented to the runtime, getting the information we need in one of the
> Collectors should be the first choice.  The ClassMetadata instances are
> immutable once they've been added to the config, correct?
>

Correct.

>
>
> -Nick
>
>
>
>
> Nicholas Gallardo
> WebSphere  - REST & WebServices Development
> nlgallar@us.ibm.com
> Phone: 512-286-6258
> Building: 903 / 5G-016