[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index


From: David Radcliffe <david.radcliffe_at_clockworkit.co.uk>
Date: Fri, 4 Jul 2014 12:48:53 +0100



When creating different instances of an application (say for different
customers), the three approaches taken might be:

1. Only one instance, with feature control enabled via parameters

2. Separate branches for each customer

3. Conditional Compilation of one source base


All three approaches have been used by the author at various companies he
has worked for,

and experience has shown that all three have their own drawbacks:

1. If the differences between instances are significant, or there are
a large number of instances, this approach rapidly becomes unwieldy

2. This creates a maintenance nightmare when applying patches or

3. This works, but implementation (e.g. Visual Studio) leaves a lot to
be desired.


This suggestion proposes a fourth method: Conditional Check-out.

This works (as far as the complier is concerned) in much the same way as
Conditional Compilation,

but moves the decision on whether to compile specific code back to the point
where the codebase is obtained from SVN,

rather than relying on the flaky mechanisms provided within the IDE.

This means that the developer has to very consciously decide which instance
she is building before even seeing the code.

It will also support automated build processes (e.g. Cruise Control) which
checks-out code for continuous integration builds.


It works like this.

Any (existing) code (which is un-adorned by the new SVN decoration) is
treated as 'common' to all instances.

This ensures 100% backwards compatibility, with no changes being required to
existing source code, or clients.


Sections of code which apply to, or are omitted from, one or more specific
instances are decorated by a new SVN decoration (both before & after the
relevant section).

This section is then either included or excluded, as appropriate, when the
code base is obtained from SVN repository.


The 'checkout' and 'update' commands in clients will have the ability to be
'told' (maybe from a pull-down list of recent values) which specific
instance should be obtained,

and SVN includes or omits sections of code as required. A special value,
over and above the user-named instances is required.

This is 'ALL CODE'. This obtains all the codebase, including all
instance-specific code, with the decorations for specific sections included.

This is primarily for documentation and review purposes, but also provides a
'base' from which further instance-specific changes can be made.


The decoration referred to is similar in fashion to the keywords already
existing in SVN, and can exist as comments in the source code.

There would be two variants of the decoration to either:

1. Include this code section only when a specific instance is
required. It will not be included for all other instances (except ALL CODE).

2. To exclude this code section when a specific instance is required.
It will be included for all other instances (including ALL CODE).

Sections of code may have multiple [start of section] decorations; the
effect is the logical-ORing of those decorations,

so that multiple instances can benefit from the same section control.


David W. Radcliffe

Senior Developer

Clockwork IT Ltd

tel: 08448 040950

mob: 07764 155251


  <http://www.supportdeskpro.co.uk/> WWW.SUPPORTDESKPRO.CO.UK

n%22%3e%3c/a> <http://twitter.com/ClockworkIT>


Clockwork IT Ltd, Saturn Business Centre, 101 Lockhurst Lane, Coventry, CV6

NOTICE-This message contains information intended only for the use of the
addressee named above. It may also be confidential and/or privileged. If you
are not the addressee, you should not disclose, copy, distribute, take any
action or rely on this E-mail and should notify us immediately by return
E-mail to <mailto:info_at_clockworkit.co.uk> info_at_clockworkit.co.uk The views
expressed in this communication may not necessarily be the views held by
Clockwork IT


image001.jpg image002.png image003.png image004.jpg image005.gif
Received on 2014-07-05 07:36:23 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.