Jozef
Jozef

Reputation: 303

How to avoid duplication of code using ClearCase UCM components

I thought I understood the concept of components in ClearCase UCM after reading all the posts on here, however, I'm pretty sure I'm missing something.

I created two projects A and B that each contain a component, Comp_A and Comp_B respectively, and they also each contain a shared component Comp_C as well as a rootless component Comp_D to contain the composite baselines.

Everything works fine. However, how does this prevent duplication of code? When making a change to the shared component in Project A, that change needs to be delivered (using an inter-project delivery of a baseline) for it to be visible in Project B, which means that all the files of the shared component that had changes made to them end up being duplicated in both projects' development and integration streams.

How can I set up a component to be shared by two projects without its code becoming duplicated?

Example: when I make a change to a file in shared component C in project A, deliver it to project A's Integration stream, create a baseline, and then proceed to deliver that baseline to project's B's Development stream followed by a delivery to project B's Integration stream and do a version tree of that file, I see 4 versions of the same file that are all identical. Granted, we're still talking about the same element, but isn't there a way in which two projects can share a component (only modifiable in one) without this happening?

I think what I'm looking for is for one project to be the "producer" and other projects to be the "consumers" of this component.

Upvotes: 2

Views: 81

Answers (1)

VonC
VonC

Reputation: 1324576

UCM Baseline are a way to reference a precise version of a set of files (the UCM components)

If you make a new baseline in project A / component C, that does not influence project B which keeps referencing its own initial version of the component C (with possibly its own changes)

When you deliver a baseline inter-project:

  • you end up referencing the exact same versions of the files labelled by that baseline label if component C in project B had not changed: no duplication there.
  • or you end up merging your changes from project A into the component C of project B, which had new versions of its own. Again, no duplication, simply a report of changes in order to integrate them in another development stream for a given component: there might be merge conflicts that need to be resolved.

when I make a change to a file in shared component C in project A, deliver it to project A's Integration stream, create a baseline, and then proceed to deliver that baseline to project's B's Development stream followed by a delivery to project B's Integration stream and do a version tree of that file, I see 4 versions of the same file that are all identical.

One way to avoid that is to:

  • reference C as non-modifiable UCM component in project A or B, which means you can, in any Stream, rebase and change its baseline at will, without having to deliver C ever.
  • Change C in a dedicated Project C, in which C is modifiable, and in which you make a C baseline (which you then can rebase in project A or B, no need for inter-project delivery)

Upvotes: 1

Related Questions