I think #file: is quite confusing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

I think #file: is quite confusing

Mariano Martinez Peck
Hi Dale. While writing the Metacello chapter, I realised that that method #file: in a reference project is quite confusing. Suppose this example:

spec
            project: 'CoolBrowser ALL' with: [
                spec
                    className: 'ConfigurationOfCoolBrowser';
                    versionString: '1.0';
                    loads: #('ALL' );
                    file: 'CoolBrowser-Metacello';
                    repository: 'http://www.example.com/CoolBrowser' ].


In that case, what I put in #file: is the name of the package where I can find the ConfigurationOfCoolBrowser class. And in all the examples I saw, is the same.

Why is it called file if it is actually a package?  I know that package: is already in use so we need another selector, but I find file:  quite confusing. I am the only one ?

Maybe there is another uses of #file: that I am not aware and that makes sense...

Thanks

Mariano
Reply | Threaded
Open this post in threaded view
|

Re: I think #file: is quite confusing

Dale
Mariano,

Without conventions, the #file: has the same meaning as #file: for a package (in fact underneath the covers a packageSpec is created with #file: and #repository:). The #file: parameter can be an explicit monticello file name or a package name, if the #file: is a package name, then the latest version of the package is loaded. So I think the name makes sense, from that perspective.

With that said, it doesn't make the name any less confusing.

Now that you bring it up...

Given that we are using conventions, I have been thinking that the #file: parameter is redundant and have been considering making it optional.

Given our current usage the following is a lot less confusing:

  spec
    project: 'CoolBrowser ALL' with: [
      spec
        className: 'ConfigurationOfCoolBrowser';
        versionString: '1.0';
        loads: #('ALL' );
        repository: 'http://www.example.com/CoolBrowser'].

The #file: can still be specified (for those who have a good reason for not following convention), but most of the users don't need to worry about it.

We could also change the #className: selector to something different while we're at it.

Dale

----- "Mariano Martinez Peck" <[hidden email]> wrote:

| Hi Dale. While writing the Metacello chapter, I realised that that
| method
| #file: in a reference project is quite confusing. Suppose this
| example:
|
| spec
|             project: 'CoolBrowser ALL' with: [
|                 spec
|                     className: 'ConfigurationOfCoolBrowser';
|                     versionString: '1.0';
|                     loads: #('ALL' );
|                     file: 'CoolBrowser-Metacello';
|                     repository: 'http://www.example.com/CoolBrowser'
| ].
|
|
| In that case, what I put in #file: is the name of the package where I
| can
| find the ConfigurationOfCoolBrowser class. And in all the examples I
| saw, is
| the same.
|
| Why is it called file if it is actually a package?  I know that
| package: is
| already in use so we need another selector, but I find file:  quite
| confusing. I am the only one ?
|
| Maybe there is another uses of #file: that I am not aware and that
| makes
| sense...
|
| Thanks
|
| Mariano
Reply | Threaded
Open this post in threaded view
|

Re: I think #file: is quite confusing

Mariano Martinez Peck


On Sun, Feb 7, 2010 at 7:52 PM, Dale Henrichs <[hidden email]> wrote:
Mariano,

Without conventions, the #file: has the same meaning as #file: for a package


uffff that's true. Sorry, I don't use almost #file:  in packages.

 
(in fact underneath the covers a packageSpec is created with #file: and #repository:). The #file: parameter can be an explicit monticello file name


I forgot about this situation where it can the the complete monticello file name ;)

 
or a package name, if the #file: is a package name, then the latest version of the package is loaded. So I think the name makes sense, from that perspective.



Yes, sorry, it makes sense :)

 
With that said, it doesn't make the name any less confusing.

Now that you bring it up...

Given that we are using conventions, I have been thinking that the #file: parameter is redundant and have been considering making it optional.

Given our current usage the following is a lot less confusing:

 spec
   project: 'CoolBrowser ALL' with: [
     spec
       className: 'ConfigurationOfCoolBrowser';
       versionString: '1.0';
       loads: #('ALL' );
       repository: 'http://www.example.com/CoolBrowser'].



Yes!!!   Here you are assuming that the package is the same name as the className, which of course is true with all the projects commited in MetacelloRepository.
 
The #file: can still be specified (for those who have a good reason for not following convention), but most of the users don't need to worry about it.



But we must make clear the convention. It must be written somewhere. People must be aware of that.

 
We could also change the #className: selector to something different while we're at it.


Do you mean to put just CoolObrowser and that Metacello understands that you are referring to ConfigurationOfXXX (ConfigurationOfCoolBrowser in our case) ?

Thanks!

Mariano
 

Dale

----- "Mariano Martinez Peck" <[hidden email]> wrote:

| Hi Dale. While writing the Metacello chapter, I realised that that
| method
| #file: in a reference project is quite confusing. Suppose this
| example:
|
| spec
|             project: 'CoolBrowser ALL' with: [
|                 spec
|                     className: 'ConfigurationOfCoolBrowser';
|                     versionString: '1.0';
|                     loads: #('ALL' );
|                     file: 'CoolBrowser-Metacello';
|                     repository: 'http://www.example.com/CoolBrowser'
| ].
|
|
| In that case, what I put in #file: is the name of the package where I
| can
| find the ConfigurationOfCoolBrowser class. And in all the examples I
| saw, is
| the same.
|
| Why is it called file if it is actually a package?  I know that
| package: is
| already in use so we need another selector, but I find file:  quite
| confusing. I am the only one ?
|
| Maybe there is another uses of #file: that I am not aware and that
| makes
| sense...
|
| Thanks
|
| Mariano

Reply | Threaded
Open this post in threaded view
|

Re: I think #file: is quite confusing

Miguel Cobá
El dom, 07-02-2010 a las 20:47 +0100, Mariano Martinez Peck escribió:

>
>         We could also change the #className: selector to something
>         different while we're at it.
>
>
> Do you mean to put just CoolObrowser and that Metacello understands
> that you are referring to ConfigurationOfXXX
> (ConfigurationOfCoolBrowser in our case) ?

I don't think that this is a good idea, at least for the Metacello code.
I think that the tools built on it, e.g Loader, are the ones allowed to
easy the specification of packages names on loading, but Metacello uses
classes to load specs, and the class is named ConfigurationOfXXX.

And Loader is soon to be released so that will be the one the end users
will use. The ConfigurationOfXXX and Metacello are for configuration
maintainers only, not for (mainly) end users.

Well, that is just MHO :)

--
Miguel Cobá
http://miguel.leugim.com.mx

Reply | Threaded
Open this post in threaded view
|

Re: I think #file: is quite confusing

Dale

----- "Miguel Enrique Cobá Martinez" <[hidden email]> wrote:

| El dom, 07-02-2010 a las 20:47 +0100, Mariano Martinez Peck escribió:
|
| >
| >         We could also change the #className: selector to something
| >         different while we're at it.
| >
| >
| > Do you mean to put just CoolObrowser and that Metacello understands
| > that you are referring to ConfigurationOfXXX
| > (ConfigurationOfCoolBrowser in our case) ?
|
| I don't think that this is a good idea, at least for the Metacello
| code.
| I think that the tools built on it, e.g Loader, are the ones allowed
| to
| easy the specification of packages names on loading, but Metacello
| uses
| classes to load specs, and the class is named ConfigurationOfXXX.
|
| And Loader is soon to be released so that will be the one the end
| users
| will use. The ConfigurationOfXXX and Metacello are for configuration
| maintainers only, not for (mainly) end users.
|
| Well, that is just MHO :)

I was thinking that #className: could have a different selector name with the same arguments (fully-qualified configuration class name), but it is probably best to stick with #className: now. eliminating the _need_ for #file: is less disruptive and eliminates some redundancy in the API.

Dale
Reply | Threaded
Open this post in threaded view
|

Re: I think #file: is quite confusing

Mariano Martinez Peck
In reply to this post by Miguel Cobá


2010/2/7 Miguel Enrique Cobá Martinez <[hidden email]>
El dom, 07-02-2010 a las 20:47 +0100, Mariano Martinez Peck escribió:

>
>         We could also change the #className: selector to something
>         different while we're at it.
>
>
> Do you mean to put just CoolObrowser and that Metacello understands
> that you are referring to ConfigurationOfXXX
> (ConfigurationOfCoolBrowser in our case) ?

I don't think that this is a good idea, at least for the Metacello code.
I think that the tools built on it, e.g Loader, are the ones allowed to
easy the specification of packages names on loading, but Metacello uses
classes to load specs, and the class is named ConfigurationOfXXX.

And Loader is soon to be released so that will be the one the end users
will use. The ConfigurationOfXXX and Metacello are for configuration
maintainers only, not for (mainly) end users.



I am agree. 

 
Well, that is just MHO :)

--
Miguel Cobá
http://miguel.leugim.com.mx