[OpenAjaxIDE] more on <require>

Jon Ferraiolo jferrai at us.ibm.com
Fri Aug 1 09:42:46 PDT 2008


Hi Kin,
What I believe you are proposing is that a metadata file can say something
like this:

[1] <require type="library" name="foo" minVersion="1.2" src="..."/>
[2] <require type="javascript" library="foo" src=..."/>

where it is implicit that [2] is referring to an asset within the "foo"
library defined by [1] and therefore 'minVersion' should not be specified
on [2] because it is part of the library defined by [1]. That makes sense.
Maybe we can turn that into a decision at Tuesday's phone call.

You seem to agree that the best approach to rules for processing <require>
element is that the tool should look for any <require type="library"
name="foo"> elements in the file no matter whether they are above or below
any <require library="foo"> elements. Let's try to turn that into a
decision at Tuesday's phone call.

I believe we still need to discuss whether the version attribute should be
'minVersion' vs 'srcVersion' vs 'version'. You seem to be inclined to have
the version attribute specify the actual version of the library that is
referenced by a <require type="library" src="..."/> element. I'll go along
with that.

But then the question is whether we should we get fancier and also specify
the range of library versions that would be acceptable. For example,
suppose one widget is designed to work with Dojo 1.1.1 and another is
designed to work with Dojo 1.1.2. My feeling is that we should punt on this
particular version-range feature for this round of the metadata spec and
simply have a single 'version' attribute that specifies the actual version
of the library. Instead of providing a version range, if a tool sees that
there are two widgets that both use a particular library, but use different
versions, then we can assume that the tool developer will figure out how to
deal with it, such as automatically using the library with the largest
version number, and/or posting a warning to the user, and/or telling the
user they can't combine those widgets on the same page.

In which case we should name the attribute 'version' or 'srcVersion'. I
would prefer 'version'.

Jon





                                                                           
             "Kin Blas"                                                    
             <jblas at adobe.com>                                             
             Sent by:                                                   To 
             ide-bounces at opena         <ide at openajax.org>                  
             jax.org                                                    cc 
                                                                           
                                                                   Subject 
             07/31/2008 02:53          Re: [OpenAjaxIDE] more on <require> 
             PM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




> > 2. Both Kin and I think it's a little weird to specify a minVersion for
> > a library when the src is obviously a specific version. What are we
> > trying to convey with this attribute, that the IDE doesn't need to copy
> > the contents of the library folder if the user already has the
> > minVersion of the same library in his site?
> >     - Do we not also need a version attribute for all require types
> > indicating what version the supplied file *is*?
>
> Regarding minVersion, that attribute is part of the pair of attributes
> which is 'name' and 'minVersion' for <require type="library" name="dojo"
> minVersion="1.0"> and is 'library', 'minVersion' for the other <require>
> constructions (e.g., <require type="javascript" library="dojo"
> minVersion="1.0"). The idea is that different widgets might reference a
> shared library from folders with different names (e.g., "dojo-release-
> 1.1.1" versus just plain "dojo") and different widgets might use slightly

> different versions of the same library (e.g., "dojo-release-1.1.1" versus

> "dojo-release-1.1.2"). The library's unique name (e.g., "dojo", unique
due
> to OpenAjax Registry) and its minimum version (e.g., "1.1.1" and "1.1.2")

> would tell the IDE that two widgets could shared dojo 1.1.2.
>
> But your comment about minVersion vs actual version is interesting. Maybe

> we need two attributes, 'minVersion' and 'srcVersion', where 'minVersion'

> tells the IDE that this widget can work with (e.g.,) dojo 1.1 or greater,

> and 'srcVersion' tells the IDE exactly which version the 'src' attribute
> is pointing to.


I was having a hard time parsing/understanding Jon's response so pardon my
thinking out loud here.

The reason it seems strange to me that minVersion would be specified on a
<require type="library"> tag is because my understanding of the intent for
that tag/type is that the widget author is stating that any files I
explicitly state as required, and tagged with the same name as this library
declaration, can be found in this library's src directory.

Now I can certainly appreciate the intent of the minVersion attribute, but
what does it actually mean when it is on a <require type="library"> tag? So
far what I've heard is that it's supposed to convey to the consumer of the
widget oam.xml file that the widget code requires functionality from a
minimal version of this library. Ok, I get that, but what is the version of
the library referred to in the src directory? Is there an assumption being
made here that any library referred to by <require type="library> must have
a library oam.xml file inside it with this versioning info? It would be
much more convenient if the current version of the library being referred
to was presented as an attribute <require type="library> tag so consumers
don't have to traverse through the library directories. Also, we don't want
to discourage widget developers that develop against libraries that haven't
provided library oam.xml files yet, from producing widget oam.xml files,
right?


So now let's talk about the minVersion attribute on a required file like
<require type="javascript" library="dojo" ... >. How does the minVersion on
a required file relate to the minVersion on the library it references? Do
they have to match? If so, then it seems unnecessary to have minVersion on
the actual file references. If they are allowed to be different, then what
does it mean? The minVersion on the library reference must be greater or
equal to the max minVersion of any file reference from that library? For
example:

<require type="library" name="dojo" minVersion="1.1.2" src="dojo-1.1.2" />
<require type="javascript" library="dojo" minVersion="1.0.3"
src="dojo.js" />
<require type="javascript" library="dojo" minVersion="1.1.2"
src="src/data.js" />
<require type="javascript" library="dojo" minVersion="1.0.0"
src="src/charting/chart.js" />

It's probably going to be easier for folks to grok if we just stick to a
minVersion on the actual library <require> tag.


> > 3. Should we specify that any libraries must be listed before any
> > individual files that might be part of that library?
>
> Regarding whether <require type="library"> having to appear before any
> other <require> elements that use the library, I would like to hear from
> implementers what they think. My guess is that implementers will tend to
> parse the whole file at once (versus streaming the file) and therefore
> when searching for elements that match <require type="library">, it is
> easier to just look at the parsed DOM for all <require type="library">
> elements no matter whether they appear before or after the other
<require>
> elements that use the library.


I guess it depends on if you're trying to do something with each require
file *as* you parse.

The safest bet is to read everything in and then make sense of everything.


--== Kin ==--

_______________________________________________
IDE mailing list
IDE at openajax.org
http://openajax.org/mailman/listinfo/ide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080801/383b3011/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080801/383b3011/attachment-0003.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic03181.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080801/383b3011/attachment-0004.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://openajax.org/pipermail/ide/attachments/20080801/383b3011/attachment-0005.gif 


More information about the IDE mailing list