Should one couple upgrade logic with newer version?

The last blog point entry on Upgrades and the documentation create a dar that contains the “upgrading” template.

If we have a template at the first version V1 (stored in v1.dar) and want to create a newer version V2 (in v2.dar), we then create an upgrade template U12. What is the advantage of storing U12 separately (ex. u.dar) as opposed to with V2 (v2.dar) ?

My main arguments in favor is that it reduces the number of dars and makes explicit the suggested upgrade path.

1 Like

The main reason I recommend having the upgrade logic in a separate DAR is to avoid a dependency from V2 on V1. If you put the upgrade logic in the same DAR, eventually V100 will still have a transitive dependency on V1. This means your DARs keep getting larger and larger and there is no chance of having any form of package pruning (does not exist yet but will eventually).

By putting the upgrade logic in a separate DAR, V2 has no dependency on V1 and the upgrade package from V2 to V3 only depends on V2 and V3 but not V1. So your DARs stay roughly the same size (unless you increase your code ofc, no way around that) and pruning would work very well.

2 Likes

Thank you.

1 Like