Search the web
Sign In
New User? Sign Up
scm-patterns · Patterns applied to Software CM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Structuring an SCM Repository   Message List  
Reply | Forward Message #1018 of 1133 |
Re: Structuring an SCM Repository

To define structure in an SCM repository, you need to make a
distinction between four dimension:

- Directory structure
- Branching structure
- Product structure
- Workspace structure

In principle there strucutures are independent dimensions which means
that one structure can be defined and changed without affecting the
other. But in practice they are often dependent.

Typical dependencies are:
- Directory & Branching
- Directory & Product
- Workspace & Directory

Directory & Branching dependencies are common in certain tools such as
Subversion or Perforce. You have a 'trunk' branch which is reflected as
a 'trunk' directory and branch directories. The tool does "smart" copy
across branches/directories to optimizes disk usage: different copies
are stored as a single instance in the repository. Tools like ClearCase
and CM Synergy support independence between directories and branches.

When having Dir & Branch dependency, typically the top level directory
reflects the branching and the lower level directories reflect the
(branch independent) directory structure.

Another common dependency is Workspace & Directory structure. You need
a workspace to access the repository. Typically, the workspace is the
top directory level. In combination with Dir & Branch dependency, the
directory structure looks like this:

workspace/branch/directory/.../filename
(dir/... reflects a tree structure of directories)

A common way of creating a directory structure independent of the
workspace and branch, is by using a mounted filesystem (possibly a
vertual filesystem) for the workspace and workspace settings to specify
the branch(e.g. in ClearCase: configspec, or in CM Synergy: reconfigure
properties). The directory structure then no longer contains a
workspace or branch identification.
Instead of mounted filesystem you can have a snapshot (copy from the
repository on a local file system). The latter maybe optimized for disk
storage by using a symbolic links (not supported on Windows) to a
shared cache.

Now the final dependency is Dir & Product. This is a very common
dependency: the directory structure reflects the product structure. For
example, when the product (or system) is decomposed into subsystems,
modules and component, then the directory structure may be:

subsystemname/modulename/componentname/dir/.../filename
(dir/... indicates other subdirectory structures)

A disadvantage of this approach is that a component that belongs to
different modules or subsystems, will occur in multiple directory
locations. This may be overcome by symbolic links (not supported on
Windows) or my "smart" copies (not supported by many SCM tools). But
the approach may confuse developers or (worse) configuration managers.

A way to overcome this is by using a single level structure:

componentname/dir/.../filename

But where to the subsystem and module go? Of course they occur in the
architectural model, but from an SCM point-of-view they are used in the
build structure. Commonly, the build structure is reflected in
makefiles and build scripts (which is yet-another-SCM-structure to
consider).

Speaking of build structure, we enter the arena of interfaces and
libraries. Typically, a build of one unit (subsystem, module,
component, or what-ever-you-define) makes use of objects of other
units. This may be source definitions (e.g. header files), generated
objects (e.g. object files, DLLs or libraries of sources and objects).
Typically, these external definitions are grouped into a seperate
directory, such as 'ext' or 'lib'. And to separate from the internal
definitions (only used within the unit), there is another directory
called 'src' or 'int'. The directory structure will then be:

componentname/ext/filename (for external interfaces)
componentname/lib/filename (for libraries)
componentname/int/filename (for internal interfaces)
componentname/src/dir/.../filename (for internal code)


So...
The question how to structure you SCM repository is not a simple one. I
welcome any comments, corrections and/or additions to the above
discussion.

Frank.




Sun Feb 25, 2007 10:11 am

fs87
Offline Offline
Send Email Send Email

Forward
Message #1018 of 1133 |
Expand Messages Author Sort by Date

Hello, are there any patterns or at least "good experience practices" for creating a structure of a configuration management repository, such a Perforce? The...
Pavel Hruby
pavelhruby
Offline Send Email
Feb 23, 2007
10:10 am

Hi Pavel Have you got a copy of the book "Practical Perforce"? Some good suggestions in there. You may wish to look at a couple of articles in my blog: ...
Robert Cowham
cowhamr
Offline Send Email
Feb 23, 2007
4:47 pm

Here are a couple of tips that you may find useful: 1) Define a structure ahead of time and try to stick to it. Create an authority that is responsible for...
Brooke Wallace
brookbot
Offline Send Email
Feb 25, 2007
8:23 am

To define structure in an SCM repository, you need to make a distinction between four dimension: - Directory structure - Branching structure - Product...
Frank Schophuizen
fs87
Offline Send Email
Feb 25, 2007
10:12 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help