We are migrating a fairly large codebase from VSS to Clearcase w\ UCM and are considering organizing our source into one or more components within a single project. What best practices\potential pitfalls should we keep in mind?
The source is organized into layers (data layer, business layer, GUI layer). The team is fairly small, developers tend to own a certain layer of the codebase and we anticipate a fair amount of branching due to parallel development efforts.
Single most dangerous pitfall:
Once a component is defined, you cannot move an element outside of this component (you can copy it and re-create it elsewhere, but you will loose its history)
Single most useful best-practice:
Understand well the nature of an UCM component: it is about coherency.
A component is a set of file which:
evolves as a single unit,
is labeled (baselined) as a whole,
is branched as a whole.
If you can make evolutions without touching another group of files, chances are you have two components.
Example of components:
an application (or a autonomous part of an application)
a technical library
a packaged set of file (for release)
The one document that should guide you to define components is the Applicative Architecture (which takes the business and functional specifications and project them onto applications which will then be specified at the technical level and implemented).
When all those components are defined, you have two approaches to manage them:
system approach (every components is writable in a UCM project): useful for starting a project, but cumbersome with legacy project: you do not need to put a baseline on each and every components simply because 3 files has changed in one of those components.
component approach: one or two writable components, the rest is there only as non-modifiable component. This is a scalable approach, allowing you to define one project per-component to develop, with a "fixed configuration" (i.e. "the other baselines", representing fixed states of the non-modifiable components you need to have in order to compile the modifiable one. You can change at any time this configuration, that is you can rebase the foundation baselines of the non-modifiable component whenever you want).
You can define as many Projects and Streams you want, allowing you to easily visualize the merge workflow.
Remember: a Stream represents a development effort.
Do not call a Stream after a resource (like VonC_stream), but after a task or set of tasks to do in that Stream (as in APP_LCH_R32_Dev: Development for 32th release of my App Launcher)
Note: UCM is just some meta-data on top of ClearCase: even if a group of file is defined as a UCM component, nothing prevents you to still making classic non-UCM branches, checkouts or checkins (in non-UCM views).
Is there a danger in creating too many fine grained components or having too many dependencies between components?
Yes, that is why Applicative Architecture is important. Again, once a component is defined, you cannot move elements between those components.
Another details to know about components is their layout:
myVob
myComponent1
myComponent2
myComponent3
A root component is always at the first level below a Vob.
You also can define a component as a all Vob but I would not recommend it (adding a Vob put stress on your Vob server. Adding a directory within an existing Vob cost nothing)
That means if you define some technical libraries as components, you cannot go as:
myLibs
Apache
ant
xalan
xerces
but will have to do:
myLibs
apapche_ant
apache_xalan
apache_xerces
Final warning: dependency (the true mark of a configuration management system)
One of the main advantage of UCM (or so I thought at the time -- 2003 --) is dependency.
If A depends on B, and I put A in my project, it will automatically include B in the same project.
Magic.
But it is broken.
First, never do root-based dependency (a root-based component is a set of file). It will break at the first overlap:
A1
B1
B2
Here you need B2 to go on building A, but A starts from A1 based on B1: B2 overrides B1. As soon as you put a baseline on A (A2), it is over. You will not be able to change B anymore. A parasite baseline (called A2!?) will have been put on the (non-modifiable!) component B because of the overlap.
Always include your dependencies in a rootless component
ADep1
A1
BDep1
B1
BDep2
B2
Here you have rootless components ADep and BDep (a rootless component is a special component which aggregates other rootless or root-based components)
You still have an override, but this time between rootless components.
That will still make a parasite baseline (on BDep, called A2), but at least you will be able to rebase BDep2 into other baselines later (BDep3, BDep4...)
More on this Incoherences and Inconsistencies of ClearCase UCM, with Rational counter-arguments here (and just after that their post, proof that their arguments are not very good to say the least).
Read also How to Leverage Clearcase’s features
Related
We are trying set up a complex project and we are trying to limit the number of views and branches.
We are working in UCM ClearCase where different groups work independently then merge into a merge branch once everything clears testing.
Is it at all possible to point the config spec of our new views to several different branches?
If so is there anything that we need to think about?
Maybe someone could post an example that they have created?
An UCM view is always related to one Stream, so using one branch (if said Stream contains modifiable components)
A base ClearCase view could be configured to monitor several branches, but only one rule (the last one which can be applied for a given file version) will prevail, ie only one branch will be selected.
So it isn't possible.
Ours is a typical implementation of clearcase UCM :
I have 2 UCM projects each of which represent a release for us. proj2 being created from a stable baseline from proj1
proj1 and proj2 work in parallel and sometimes same elements in both get changed simultaneously. So files a.java lies in both projects and is being worked upon by developers at both. A weekly merge activity happens where downstream gets the latest from upstream project and merges are reconciled.This is my easy life.
As a part of restructuring code, team with proj2 has started moving elements (files mostly) to other places. When I say other places this could mean within the component or to a different component VOB. This has never happened before.
The actual problem:
When an inter-project merge happens, the destination branch version of element a.java could have been moved to a different location/folder. How do I ensure clearcase still merges it with the version coming from upstream project. Is using the cleartool move command enough for clearcase to know and merge at the right place ? For inter-VOB movements, will cleartool relocate command do the same for me. I am in a tightly controlled environment else would have created a sandbox and tested it myself.
I am banking #VonC or #Tamir :)
When I say other places this could mean within the component or to a different component VOB
Note that with UCM, you cannot move elements to another component without re-creating completely said element (new history).
-For inter-vob component refactoring:
I would rather mirror the refactoring in proj1 (in a special Stream) and then attempt an inter-project merge from that stream, rather than hoping that a merge from an old directory structure to a new refactored directory structure goes well.
For outer-vob component refactoring (new history)
A manual merge is safer in that case.
I was told to create component in UCM.
How would you explain a difference between component and VOB to a beginner?
Also It asks two option.
Components in VOB and Components without VOB.
What is the use of having Component without VOB?
You always have a Vob involved with a Component.
A Vob is the database (file-based database, not an SQL-based) containing all versions of all elements (files and directories).
Not to be mixed with a PVob, which is a special kind of Vob containing only UCM metadata (like the list of UCM projects, streams, components names, activities, ...).
You have two kinds of components, but each one is a coherent set of files:
Vob component: the all Vob is a component.
Root-based components: the component has its root in the first directory level of a Vob: \aVob\aRoot.
It is best to create root-based components (ie, several components per Vob), because each Vob you would create means several processes to manage it (vob_server, vob_rpc), and it becomes quite resource intensive quickly.
However, several components (even an hundred) within a Vob is not a problem.
But that means the name of your Vob must be "generic" enough to accommodate your components.
As for rootless components (with a PVob, but no Vob), see "About rooted and rootless ClearCase UCM components".
Rootless Components:
should NEVER be modifiable in a UCM environment.
are not associated with a data storage (vob-less)
are used to track changes from Other Components.
can contain dependency lists also known as a (Composite baseline Structure)
are tracked with baselines that have NO corresponding label type.
Rootless Components should only be used to track the progress of Rooted Components.
Rootless component baselines should be used when rooted component dependencies are needed. The dependencies are rigid and can enforce a strict process once implemented.
See "To create a composite baseline" to see a rootless component in action.
I don't think the question is answered. VonC described two types of VOBs can be created, a single component VOB and multi-component VOB, to store the files. The question however is asking what's the use of creating a component w/o a VOB, one of the options when you create a component.
This type of rootless components are normally used to store the composite baseline. I am not aware of other usages.
I found this post because today I got an issue with my IIB projects. When loading dependency projects from another component, IIB toolkit will complain the dependency project is not from the same root directory (due to from different components in CC). This is really an IIB toolkit issue, but I am looking for a way to resolve this from CC.
This is a follow up question to this answer: https://stackoverflow.com/a/9579131/1204799
"It is best to create root-based components"
If I have several standalone applications (which means their development and deployment are independent), shouldn't I create different VOB to accommodate them? What I'm doing now is that, I have one single PVob, which contains a few UCM projects, each UCM project has its own Vob and baseline component(a component without Vob). Am I doing it the wrong way?
Updated at Mar-7 16:29
After taking your advice, this is what I am trying to do now:
I created a single PVOB to accomodate all the VOBs
I created one VOB for each business team, which, in my company, only three teams
I created one UCM project for each application. Each business team
will host several applications, each application is rather
independent, but every application may have more than one branch for
parallel development, so there can be a lot of projects
Here comes my question:
Now several applications are sharing the same VOB, how can I better manage the baselines so that they are organized by applications? i.e. to prevent accidentally choosing baselines of another project
It is best to use multiple components within a (generically) named Vob.
Making a component per Vob is not "wrong" per say, but you need to know that, once a component has been assigned a root directory (like a Vob), you can no longer change that root, or make any refactoring.
By "refactoring", I allude to the classic case where I create a component "MyProject" (with its Vob '\MyProject'... before realizing, for example, a few months later that 'MyProject' has actually a server and a client modules which could benefit from a separate history: I should have defined two components and not one.
With the "one vob per component" model, I have no other choice that to create another Vob: I cannot refactor, ie I cannot make a subdirectory within my existing component, and define a second component there.
With the "multiple components per Vob", I can:
rename my first component as "MyProject_Server", with its root directory '\MyVob\myproject' (which remains unchanged: you cannot change the root directory of a component once created),
make another component within the same Vob: "MyProject_Client", with a root directory '\MyVob\myproject_client'.
The main advantage is about scale: you can define many (hundreds) components within a Vob.
But you shouldn't define hundreds Vobs, because of the sheer number of processes (vobrpc_server and vob_server) required to manage the access to said Vobs.
If you create several components per Vob, that won't have any influence on the baseline choice for each project UCM.
Ie you would have as much risk of choosing the baseline of the wrong component, whether those components are a full Vob or are part of a Vob.
You would simply separate those components in different UCM projects, and manage each component baselines in those UCM projects.
There are two scenarios:
- We have created a number of components each in their own vobs and realize now we prefer to keep them within a single vob
- We have created a component inside what ends up being the incorrect vob.
In both cases, the vobs are UCM vobs (CQ enabled) and have had projects, development activities delivered and baselines created, etc.
Our objective is to reorganize the components and code into the desired location.
Rational support indicates there is no method to achieve this:
Move UCM components between PVOBs
Do you have any strategies for accomplishing this while retaining the relevant information?
The simple approach would be to extract the current baseline and check that code into a new component in the correct vob as a new baseline, then obsolete the component in the old vob. Any other suggestions?
We are using Clearcase 7.0.1.1
Those reorganization processes always involve, with UCM, to duplicate the few latest baselines of those components into the new UCM destination component, and then keeping the old history.
(with CC7.0.x as well as latest CC7.1.2)
That is why I would suggest to lock the old components/streams/projects, but not to obsolete them, in order for the version trees of the old elements to still be visible (for reference).
Note that moving an element between components is possible is the "new ClearCase" called Jazz VCS, part of RTC -- Rational Team Concert --, as explained in this thread: "Team > Move in Repository" (albeit only for top level directory).
That is why the technote you reference states (for ClearCase refactoring between components):
The decision was made by Product Management to exclude the addition of this feature from future upgrades and releases due to the significant architectural changes required to implement the solution.
It will stay that way forever with ClearCase, since ClearCase has been rewritten already... but as a module of RTC.