ant elder wrote:
On 6/17/07, Mike Edwards <[EMAIL PROTECTED]> wrote:
<snip>
The component name may be nothing like the implementation name
How does that fit with the spec saying - ""A component type file has the
same name as the implementation file but has the extension
".componentType""
? I'm looking for a way to make the default case easy, it doesn't have to
deal with every edge case.
Here's an example:
component name: CalculatorServiceComponent
implementation class: calculator.CalculatorImpl
implementation file: src/main/java/calculator/CalculatorImpl.java
componentType file:
src/main/resources/calculator/CalculatorImpl.componentType
another one:
component name: CalculatorServiceComponent
implementation class: calculator.CalculatorImpl$AnotherImpl
implementation file: calculator.CalculatorImpl.java
componentType file suggestion:
src/main/resources/calculator/CalculatorImpl.AnotherImpl.componentType
a third one with two components:
component 1 name: CalculatorServiceComponent
component 2 name: AnotherCalculatorComponent
implementation class: calculator.CalculatorImpl
implementation file: src/main/java/calculator/CalculatorImpl.java
componentType file:
src/main/resources/calculator/CalculatorImpl.componentType
This shows that:
- the component type file path cannot always be automatically derived
from the implementation file without implementation specific logic
- the component type file path cannot be derived from the component
name at all
The componentType file is really to be thought of as an extension of the
implementation for those (hopefully few) cases where introspection of
the implementation cannot provide the required information.
Maybe "implementationType" would have been be a better name :-)
Here's my understanding of the relationships between component,
component type, implementation and implementation type:
- componentType describes a type of component
- implementation is a concrete representation of a component type
- a componentType describes an implementation
- a component is an instance of a component type
- implementation type characterizes a type of implementation, a
programming language or technology, "java", "bpel", "script" for example.
My suggestion is that the SPI should put the burden on the
implementation module - for example a special method on the
xxxImplementation class with a name like "locateComponentTypeFile".
Actual loading of the componenttype file can be generic, but finding the
file is definitely a job for the implementation-handling code.
Implementation.getURI() already exists and seems the right method for this.
The problem with this is some don't want the simple xxxImplementation
class
to even be implementing any interface
Making more difficult to replace these classes by others.
so ideally as much generic function
would be built in the runtime, and thats what I'm trying to find a way of
doing.
I was wondering if the contribution service could help here. It could
discover all the .componentType files in a contribution making their
names
available,
Doesn't it do it already?
the values of all the attributes of the xxxImplementation class
are also known so it could compare all the attribute values against
all the
found .componentType file names ignoring the file extension and when
there's
a match thats the .componentType for the implementation. How does that
sound?
...ant
It sounds unpredictable :)
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]