empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <doeb...@esteam.de>
Subject Once again looking for a better name
Date Mon, 08 Feb 2010 23:09:57 GMT
Hi everyone,

 

I have already raised this question twice but had no satisfactory answer, so I am hereby trying
again:

 

Generally I think it is a great idea to specify the Nullable, NotNull, AutoGenerated capabilities
of a column with an enum rather than boolean as before.

The main advantage is the readability of the data model definition.

Currently we're using an enumeration called DataMode simply because I could not think of a
better name at the time.

But I don't think the name is good. There must be something better.

This is what it looks like at the moment:

 

// Example for "DataMode"

DEPARTMENT_ID   = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, DataMode.AutoGenerated,
"DEP_ID_SEQUENCE");

NAME            = addColumn("NAME",             DataType.TEXT,         80, DataMode.NotNull);

HEAD            = addColumn("HEAD",             DataType.TEXT,         80, DataMode.Nullable);

BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, DataMode.NotNull,
"ITTK");

UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, DataMode.AutoGenerated);

 

Since the enum reflect the update capabilities of a column how about UDC (short for update
capabilities):

// Example for "Udc"

DEPARTMENT_ID   = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, UDC.AutoGenerated,
"DEP_ID_SEQUENCE");

NAME            = addColumn("NAME",             DataType.TEXT,         80, UDC.NotNull);

HEAD            = addColumn("HEAD",             DataType.TEXT,         80, UDC.Nullable);

BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, UDC.NotNull, "ITTK");

UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, UDC.AutoGenerated);

 

What about Caps

// Example for "Caps"

DEPARTMENT_ID   = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, Caps.AutoGenerated,
"DEP_ID_SEQUENCE");

NAME            = addColumn("NAME",             DataType.TEXT,         80, Caps.NotNull);

HEAD            = addColumn("HEAD",             DataType.TEXT,         80, Caps.Nullable);

BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, Caps.NotNull, "ITTK");

UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, Caps.AutoGenerated);

 

Or Mod (short for Modifier)?

// Example for Mod

DEPARTMENT_ID   = addColumn("DEPARTMENT_ID",    DataType.AUTOINC,       0, Mod.AutoGenerated,
"DEP_ID_SEQUENCE");

NAME            = addColumn("NAME",             DataType.TEXT,         80, Mod.NotNull);

HEAD            = addColumn("HEAD",             DataType.TEXT,         80, Mod.Nullable);

BUSINESS_UNIT   = addColumn("BUSINESS_UNIT",    DataType.TEXT,          4, Mod.NotNull, "ITTK");

UPDATE_TIMESTAMP= addColumn("UPDATE_TIMESTAMP", DataType.DATETIME,      0, Mod.AutoGenerated);

 

Any other ideas are also welcome.

 

BTW: Finding a good name for a class, function or variable is the most challenging part of
programming (my phrase)

 

Rainer

 

 


Mime
View raw message