Baseline subclasses

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

Baseline subclasses

NorbertHartl
I’m trying to customize our current project with multiple baselines meaning BaselineOfCoreProduct and BaselineOfWhiteLabelProduct. The latter is a subclass of the former. My problem is that I don’t know which way to choose for loading because

Metacello new
    baseline: #WhiteLabelProduct
    load

that does not work if BaselineOfCoreProduct is in its own package because that is not loaded but the superclass is in there. I saw that I can provide an array to baseline: but regardless in which order I put them the wrong is always loaded first. So order of the array seem not to matter.


I could still load BaselineOfCoreProduct first and then BaselineOfWhiteLabelProduct but I would like to have a better way of doing. I could also image putting both baselines in the same package but I don’t know how to use Metacello to say it should load a package name and use another named Baseline.

Any help appreciated,

Norbert
Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

Dale Henrichs-3
Do I understand you correctly that the BaselineOfWhiteLabelProduct is a
subclass of BaselineOfCoreProduct?

If so, I have no idea what would happen and it certainly has never been
tested ... and as I think about this I can see that there would
definitely be problems ... I think you are lucky that you ran into
problems right off the bat:)

I know that a BaselineOf is a class and folks have been having fun
partitioning their BaselineOf "code" into different methods ... but the
fact that a BaselineOf is a class was a matter of convenience way back
when the only thing that could be versioned was a package and packages
only held onto classes ... and with a class, the browser could be
leveraged as a tool ...

If STON had existed back then and we had been using a disk based SCM, I
would have chosen STON for project specifications instead of a package
and a class (as I'm doing today with Rowan) ...

I understand what you are trying to do (I think) and I am (hopefully)
addressing what you are trying to do in Rowan, but I'm afraid that you
are just be out of luck trying to do this sort of thing with Metacello ...

You might be able to hack a solution that would _appear_ to work by
using a shared abstract superclass of both products and include the
superclass in both packages ... but I'm afraid that this approach would
more than likely just give you a bit more rope to hang yourself with
down the road:) ... of course putting the same class in two different
packages is problematic all by itself ...

I think that your best bet is to create a single BaselieOf and
differentiate your two products with two groups ... I know it's not
ideal, but at least this kind of thing has been pretty heavily tested ...

Dale

On 4/24/19 9:24 AM, Norbert Hartl wrote:

> I’m trying to customize our current project with multiple baselines meaning BaselineOfCoreProduct and BaselineOfWhiteLabelProduct. The latter is a subclass of the former. My problem is that I don’t know which way to choose for loading because
>
> Metacello new
>      baseline: #WhiteLabelProduct
>      load
>
> that does not work if BaselineOfCoreProduct is in its own package because that is not loaded but the superclass is in there. I saw that I can provide an array to baseline: but regardless in which order I put them the wrong is always loaded first. So order of the array seem not to matter.
>
>
> I could still load BaselineOfCoreProduct first and then BaselineOfWhiteLabelProduct but I would like to have a better way of doing. I could also image putting both baselines in the same package but I don’t know how to use Metacello to say it should load a package name and use another named Baseline.
>
> Any help appreciated,
>
> Norbert

Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

NorbertHartl


> Am 24.04.2019 um 19:40 schrieb Dale Henrichs <[hidden email]>:
>
> Do I understand you correctly that the BaselineOfWhiteLabelProduct is a subclass of BaselineOfCoreProduct?
>
Yes as I wrote.

> If so, I have no idea what would happen and it certainly has never been tested ... and as I think about this I can see that there would definitely be problems ... I think you are lucky that you ran into problems right off the bat:)
>
If tried other ways like complete separate baseline. But referencing all entities from a foreign baseline to reuse is cumbersome.

> I know that a BaselineOf is a class and folks have been having fun partitioning their BaselineOf "code" into different methods ... but the fact that a BaselineOf is a class was a matter of convenience way back when the only thing that could be versioned was a package and packages only held onto classes ... and with a class, the browser could be leveraged as a tool ...
>
> If STON had existed back then and we had been using a disk based SCM, I would have chosen STON for project specifications instead of a package and a class (as I'm doing today with Rowan) ...
>
> I understand what you are trying to do (I think) and I am (hopefully) addressing what you are trying to do in Rowan, but I'm afraid that you are just be out of luck trying to do this sort of thing with Metacello ...
>
The basic thing I would bewd is to load one package and execute a baseline with a different name.

> You might be able to hack a solution that would _appear_ to work by using a shared abstract superclass of both products and include the superclass in both packages ... but I'm afraid that this approach would more than likely just give you a bit more rope to hang yourself with down the road:) ... of course putting the same class in two different packages is problematic all by itself ...
>
> I think that your best bet is to create a single BaselieOf and differentiate your two products with two groups ... I know it's not ideal, but at least this kind of thing has been pretty heavily tested ...

I had something like this but defining the number of packages to load is easy to do in a polymorphic way. I don‘t have an idea how to achieve this with a group. It is about changing the number of dependencies of one package.

So no way of making Metacello load a package with one name and load a baseline with another name?

Thanks,

Norbert

>
> Dale
>
>> On 4/24/19 9:24 AM, Norbert Hartl wrote:
>> I’m trying to customize our current project with multiple baselines meaning BaselineOfCoreProduct and BaselineOfWhiteLabelProduct. The latter is a subclass of the former. My problem is that I don’t know which way to choose for loading because
>>
>> Metacello new
>>     baseline: #WhiteLabelProduct
>>     load
>>
>> that does not work if BaselineOfCoreProduct is in its own package because that is not loaded but the superclass is in there. I saw that I can provide an array to baseline: but regardless in which order I put them the wrong is always loaded first. So order of the array seem not to matter.
>>
>>
>> I could still load BaselineOfCoreProduct first and then BaselineOfWhiteLabelProduct but I would like to have a better way of doing. I could also image putting both baselines in the same package but I don’t know how to use Metacello to say it should load a package name and use another named Baseline.
>>
>> Any help appreciated,
>>
>> Norbert
>


Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

Dale Henrichs-3

On 4/24/19 3:08 PM, Norbert Hartl wrote:
> I don‘t have an idea how to achieve this with a group. It is about changing the number of dependencies of one package.

There's load order and there's grouping...

If you are using #linear loads for a BaselineOf then hard dependencies
(Metacello requires:) dictate load  order and load order is important.

If you are using #atomic loads, then load order for packages is not
important ... for #atomic loads you only need to specify which set of
packages you want to have loaded together ... so if you have a baseline
where you don't use #requires: anywhere and simply define different
groups for each set of package to want to have loaded together (one for
productA and another for productB) ... you should be able to get what
you want ...

If this is a public baseline, then you have to warn users of your
project that the only legally loadable entities are the set of groups
that you've created, then things should work well ... ... I'd think:)

>
> So no way of making Metacello load a package with one name and load a baseline with another name?

Not sure what you are thinking about here ... i think I need a concrete
example of what you mean here...

Dale


Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

NorbertHartl


> Am 25.04.2019 um 01:13 schrieb Dale Henrichs <[hidden email]>:
>
>
> On 4/24/19 3:08 PM, Norbert Hartl wrote:
>> I don‘t have an idea how to achieve this with a group. It is about changing the number of dependencies of one package.
>
> There's load order and there's grouping...
>
> If you are using #linear loads for a BaselineOf then hard dependencies (Metacello requires:) dictate load  order and load order is important.
>
> If you are using #atomic loads, then load order for packages is not important ... for #atomic loads you only need to specify which set of packages you want to have loaded together ... so if you have a baseline where you don't use #requires: anywhere and simply define different groups for each set of package to want to have loaded together (one for productA and another for productB) ... you should be able to get what you want ...
>
> If this is a public baseline, then you have to warn users of your project that the only legally loadable entities are the set of groups that you've created, then things should work well ... ... I'd think:)
>
>>
>> So no way of making Metacello load a package with one name and load a baseline with another name?
>
> Not sure what you are thinking about here ... i think I need a concrete example of what you mean here…
>
Sorry, I wasn’t clear. I was talking about the possibility to have a basline loaded where the package name and the name of the baseline are not the same. So let’s say I have the two baselines in the BaselineOfCoreProduct. Then I would need to do something like

Metacello new
   package: „BaselineOfCoreProduct“;
   baseline: #BaselineOfWhiteLabelProduct;
   load

That would be sufficient. Having all the baselines in one package would be a smaller problem then.

Norbert




Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

NorbertHartl
Dale,

looking at my code I really like the idea solving my white label problem with polymorphism. It makes things much easier IMHO. So ended up doing something like having something like this

BaselineOfCoreProduct
    spec group: ‚whiteLabel‘ with: #( ‚BaselineOfWhiteLabelProduct‘ )

and doing 

    Metacello new
       baseline: #CoreProduct
       load: ‚whiteLabel‘;
       baseline: #WhiteLabelProduct;
       load

This way each baseline is still in its own package. The project is not for public consumption so we have to do that in our deployment process nowhere else.

Norbert


Am 25.04.2019 um 09:51 schrieb Norbert Hartl <[hidden email]>:



Am 25.04.2019 um 01:13 schrieb Dale Henrichs <[hidden email]>:


On 4/24/19 3:08 PM, Norbert Hartl wrote:
I don‘t have an idea how to achieve this with a group. It is about changing the number of dependencies of one package.

There's load order and there's grouping...

If you are using #linear loads for a BaselineOf then hard dependencies (Metacello requires:) dictate load  order and load order is important.

If you are using #atomic loads, then load order for packages is not important ... for #atomic loads you only need to specify which set of packages you want to have loaded together ... so if you have a baseline where you don't use #requires: anywhere and simply define different groups for each set of package to want to have loaded together (one for productA and another for productB) ... you should be able to get what you want ...

If this is a public baseline, then you have to warn users of your project that the only legally loadable entities are the set of groups that you've created, then things should work well ... ... I'd think:)


So no way of making Metacello load a package with one name and load a baseline with another name?

Not sure what you are thinking about here ... i think I need a concrete example of what you mean here…

Sorry, I wasn’t clear. I was talking about the possibility to have a basline loaded where the package name and the name of the baseline are not the same. So let’s say I have the two baselines in the BaselineOfCoreProduct. Then I would need to do something like

Metacello new
  package: „BaselineOfCoreProduct“;
  baseline: #BaselineOfWhiteLabelProduct;
  load

That would be sufficient. Having all the baselines in one package would be a smaller problem then.

Norbert

Reply | Threaded
Open this post in threaded view
|

Re: Baseline subclasses

Dale Henrichs-3

Ahhh! Interesting solution to your problem ... funky but using tested features!

On 4/25/19 1:23 AM, Norbert Hartl wrote:
Dale,

looking at my code I really like the idea solving my white label problem with polymorphism. It makes things much easier IMHO. So ended up doing something like having something like this

BaselineOfCoreProduct
    spec group: ‚whiteLabel‘ with: #( ‚BaselineOfWhiteLabelProduct‘ )

and doing 

    Metacello new
       baseline: #CoreProduct
       load: ‚whiteLabel‘;
       baseline: #WhiteLabelProduct;
       load

This way each baseline is still in its own package. The project is not for public consumption so we have to do that in our deployment process nowhere else.

Norbert


Am 25.04.2019 um 09:51 schrieb Norbert Hartl <[hidden email]>:



Am 25.04.2019 um 01:13 schrieb Dale Henrichs <[hidden email]>:


On 4/24/19 3:08 PM, Norbert Hartl wrote:
I don‘t have an idea how to achieve this with a group. It is about changing the number of dependencies of one package.

There's load order and there's grouping...

If you are using #linear loads for a BaselineOf then hard dependencies (Metacello requires:) dictate load  order and load order is important.

If you are using #atomic loads, then load order for packages is not important ... for #atomic loads you only need to specify which set of packages you want to have loaded together ... so if you have a baseline where you don't use #requires: anywhere and simply define different groups for each set of package to want to have loaded together (one for productA and another for productB) ... you should be able to get what you want ...

If this is a public baseline, then you have to warn users of your project that the only legally loadable entities are the set of groups that you've created, then things should work well ... ... I'd think:)


So no way of making Metacello load a package with one name and load a baseline with another name?

Not sure what you are thinking about here ... i think I need a concrete example of what you mean here…

Sorry, I wasn’t clear. I was talking about the possibility to have a basline loaded where the package name and the name of the baseline are not the same. So let’s say I have the two baselines in the BaselineOfCoreProduct. Then I would need to do something like

Metacello new
  package: „BaselineOfCoreProduct“;
  baseline: #BaselineOfWhiteLabelProduct;
  load

That would be sufficient. Having all the baselines in one package would be a smaller problem then.

Norbert