Board index » delphi » Data Dictionary and Version Control

Data Dictionary and Version Control

I've run into a logistical problem with using the data dictionary (DD).
In particular, I'm concerned about version control.

Here's the problem:  

To create a data dictionary, you need an alias set up, so you
have a database into which you can insert the table which defines
the DD.  That alias is defined in the BDE as by an absolute path,
and/or a database driver.  Since I may be playing with multiple
versions of the program (bug fix, new development, etc), I want
multiple versions of the DD.  As far as I'm concerned, it's a
piece of source code, just like any other, and needs to be
versioned (<-- yet a nother perfectly good noun "verbed" to
death :-) ) a verb.

However, since I have to use an alias to set up a DD, and that
data has to have an absolute path, there doesn't appear to be any
way to create a DD in, say, the current (or sub) directory based
on my delphi project, then check that into a version control
system as part of my whole project, then check it out in some
other directory, so that I may work on one version of the
project, without affecting another.

I could solve this problem if I had a way to either:

Create a DD without using the bde, and just go strait to a file
or files.

or

Create an alias with a relative path, so that Delphi opens
it up relative to the location of the project file,( or more
likely, the desktop file - .dsk).

Otherwise, I will have to live with the absolute location of the
dd, and then be very careful about checking one version in before
checking another out out if I wish to switch projects.  That
could get very dangerous, though.

Anybody have any ideas?

---
Michael Conner
Milwaukee Software Co, Inc.
mcon...@execpc.com

 

Re:Data Dictionary and Version Control


Quote
Mike Conner (mcon...@earth.execpc.com) wrote:

: I've run into a logistical problem with using the data dictionary (DD).
: In particular, I'm concerned about version control.
:
: Here's the problem:  
:
: To create a data dictionary, you need an alias set up, so you
: have a database into which you can insert the table which defines
: the DD.  That alias is defined in the BDE as by an absolute path,
: and/or a database driver.  Since I may be playing with multiple

Hallo Mike,

you do not have to define alias in BDE configuration.
You can do at runtime also.

1st possiblity is to use TDatabase component. it's Alias property will
reference to BDE alias or directory path. it's DatabaseName (???) property
is used _inside_ this program as alias.

You  can store your path in ini file (or just have it hardcoded).

procedure FormCreate ...
begin
  { note, that databasename should be defined at dasigntime }
  DataBase.Alias := 'C:\TEMP\VER1';
  DataBase.Connected := True;
  { do your table's stuff here .. }
end;

2nd possibility is to use BDE function dbiAddAlias...
there is nice component called AisIni in Delphi Superpage with source.
you can look from there how :WORK: and :PRIV: aliases can be added at runtime.

: versions of the program (bug fix, new development, etc), I want
: multiple versions of the DD.  As far as I'm concerned, it's a
: piece of source code, just like any other, and needs to be
: versioned (<-- yet a nother perfectly good noun "verbed" to
: death :-) ) a verb.

hmm, what about implementing versioning _inside_ your dd table?

hope it helps
Tanel

PS:
does/will your dd modeller support any code generation (template based)?
I have found really convinient to use components with fields published as
propertys and it is easy to generate from dd (if you have generator ;-)
ie, CustTable.CustomerNo := 220;

  TCustTable = class (TTable)
  private
    funtion GetCustomerNo: LongInt;
    procedure SetCustomerNo(i: LongInt);
  public
    property CustomerNo: LongInt read getCustomerNo write SetCustomerNo;
  end;

implementation

function TCustTable.GetCustomerNo: LongInt;
begin
  Result := FieldByName('CustomerNo').asInteger;
end;

procedure TCustTable.SetCustomerNo(i: LongInt);
begin
  FieldByName('CustomerNo').asInteger := i;
end;

you can also add properties for fields..

{end of PS }

: However, since I have to use an alias to set up a DD, and that
: data has to have an absolute path, there doesn't appear to be any
: way to create a DD in, say, the current (or sub) directory based
: on my delphi project, then check that into a version control
: system as part of my whole project, then check it out in some
: other directory, so that I may work on one version of the
: project, without affecting another.
:
: I could solve this problem if I had a way to either:
:
: Create a DD without using the bde, and just go strait to a file
: or files.
:
: or
:
: Create an alias with a relative path, so that Delphi opens
: it up relative to the location of the project file,( or more
: likely, the desktop file - .dsk).
:
: Otherwise, I will have to live with the absolute location of the
: dd, and then be very careful about checking one version in before
: checking another out out if I wish to switch projects.  That
: could get very dangerous, though.
:
: Anybody have any ideas?
:
:
: ---
: Michael Conner
: Milwaukee Software Co, Inc.
: mcon...@execpc.com

Other Threads