Re: MORE QUESTIONS: copy of JMI extents

Martin Matula <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi Holger,

Holger Krug wrote:
> Structure factories in generated classes
> ========================================
> 
> For the generated classes/interfaces I would provide an interface
> MyStruct and a class MyStructDefault implementing the interface. The
> class has its constructor(s) as public factories.  No implementor
> should have problems with this. It would be possible to restructure
> values of MyStruct when given in attribute setters as needed by the
> implementation. The implementation type of the values returned by
> attribute getters could be specific to the implementation.

I agree that the default implementation of structs should not be a 
problem for any vendor, since all of them have to accept any 
implementation of RefStruct since structs are repository independent.
However, you would not believe, how hard it was to negotiate that the 
default implementation class will be generated at least for enumerations...

> 
> Structure factories in reflective classes
> =========================================
> 
> For the reflective classes/interfaces I would allow to provide
> instances of Map (or RefStructMap, a new class similar to Map, which
> which enforces the keys to be String's resp. StructureField's) and
> allow to set a Map value where a structure value is required.
> Alternatively one could think about Object[], what would be more
> performant.
> 
> Not related by also a result of my experiences with generic JMI
> coding:
> 
> Not allowing class type inside datatypes
> ========================================
> 
> In MOF I would not allow class types inside collection or structure
> types at all. It's semantically strange, probably never used and
> creates only problems. If *really* necessary as a replacement one
> could introduce a reference type, where values of references types are
> *externalizable* references to instances.
> 
> The JMI spec would contain a class or interface Reference which
> extends Serializable and describe how the referred instance can be
> accessed given a reference value. This behaviour could even be fully
> or partially implementation dependent.
> 
>

These are interesting suggestions. Send them to [email protected] 
(including the suggestion about generating the default structure 
implementations).
Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.