Click here to Skip to main content
15,891,033 members
Home / Discussions / Database
   

Database

 
Questiondataview and databinding ? Pin
Isabel oliveira24-Jan-06 14:40
Isabel oliveira24-Jan-06 14:40 
QuestionImport Cast Error in SQL Server 2005 Pin
Tiger45623-Jan-06 18:55
Tiger45623-Jan-06 18:55 
Questiontable construction/design question Pin
Jim Crafton23-Jan-06 15:36
Jim Crafton23-Jan-06 15:36 
AnswerRe: table construction/design question Pin
Rob Graham23-Jan-06 17:14
Rob Graham23-Jan-06 17:14 
GeneralRe: table construction/design question Pin
Jim Crafton24-Jan-06 2:47
Jim Crafton24-Jan-06 2:47 
GeneralRe: table construction/design question Pin
Jim Crafton26-Jan-06 16:20
Jim Crafton26-Jan-06 16:20 
GeneralRe: table construction/design question - RESOLVED Pin
Jim Crafton26-Jan-06 17:54
Jim Crafton26-Jan-06 17:54 
AnswerRe: table construction/design question Pin
Damodar Periwal24-Jan-06 12:53
Damodar Periwal24-Jan-06 12:53 
If your use cases are such that at most of the places you need to lookup objects of one particular type (e.g., give me a class by this name, give me all the variables with this property, ...), you may be better off storing objects of each type in a separate table. This will help in better performance because less number of records needs to be filtered during a query for a particular type of object. This will also provide better data normalization if the information for each type is quite different than that for the other ones.

If you are developing your application in C# or some other managed language, you may use an OR-Mapping product to totally avoid dealing with tedious low-level infrastructire code in ADO.NET or OleDb for data integration. For example, with NJDX OR-Mapper, you may do the following:

1- Define your domain model classes (say AClass, AStruct, AUnion, AVariable, AnEnum, etc.) with properties for name, offset, etc.). For example,

class AClass {<br />
  string name;<br />
  int offset;<br />
  ...<br />
}


If some classes are very similar, you may define them in a class-hierarchy.

2- Define OR-Mapping declaratively like:

CLASS AClass TABLE CLASSES<br />
  PRIMARY_KEY name<br />
;<br />
<br />
CLASS AUnion TABLE UNIONS<br />
  PRIMARY_KEY name<br />
;


3- Create the database schema using NJDXSchema tool. This will create tables CLASSES, UNIONS, etc, with proper columns and primary keys.

4- Write your application using NJDX APIs. For example, the following code will insert a new object c1 of type AClass in the database:

  njdx.insert(c1, 0, null);

The following code will fetch an AUnion object having name="someUnion"

  // oid below can be built dynamically using program variables<br />
  Object oid = ObjectId.createObjectId("AUnion;name=someUnion");<br />
  AUnion myUnion = njdx.getObjectById(oid, true, 0, null);


The following code will fetch all AClass objects into the myClasses variable.

  ArrayList myClasses = njdx.query("AClass", null, -1, 0, null);

If you have defined some of your classes in a hierarchy, you can fetch all the qualifying objects of all the classes in that hierarchy with one query call.

Essentially, your code will be more object-oriented and easier to evolve. And you will avoid all the complexities of SQL.

Damodar Periwal
Software Tree, Inc.
Simplify Data Integration
http://www.softwaretree.com


-- modified at 18:55 Tuesday 24th January, 2006
GeneralRe: table construction/design question Pin
Jim Crafton24-Jan-06 15:35
Jim Crafton24-Jan-06 15:35 
GeneralRe: table construction/design question Pin
Damodar Periwal24-Jan-06 15:46
Damodar Periwal24-Jan-06 15:46 
QuestionHow to send email on perticular date and time? Pin
vicky45723-Jan-06 13:57
vicky45723-Jan-06 13:57 
AnswerRe: How to send email on perticular date and time? Pin
Qaiser Mehmood Mughal24-Jan-06 3:33
Qaiser Mehmood Mughal24-Jan-06 3:33 
GeneralRe: How to send email on perticular date and time? Pin
vicky45724-Jan-06 6:58
vicky45724-Jan-06 6:58 
Questionarrange by nearest date? Pin
jszpila23-Jan-06 10:03
jszpila23-Jan-06 10:03 
AnswerRe: arrange by nearest date? Pin
Colin Angus Mackay23-Jan-06 11:47
Colin Angus Mackay23-Jan-06 11:47 
GeneralRe: arrange by nearest date? Pin
jszpila23-Jan-06 12:25
jszpila23-Jan-06 12:25 
GeneralRe: arrange by nearest date? Pin
Colin Angus Mackay23-Jan-06 12:32
Colin Angus Mackay23-Jan-06 12:32 
GeneralRe: arrange by nearest date? Pin
jszpila24-Jan-06 3:45
jszpila24-Jan-06 3:45 
QuestionGetDate() in Stored Procedure Pin
Michael Flanakin23-Jan-06 5:35
Michael Flanakin23-Jan-06 5:35 
GeneralRe: GetDate() in Stored Procedure Pin
Michael Flanakin23-Jan-06 5:38
Michael Flanakin23-Jan-06 5:38 
GeneralRe: GetDate() in Stored Procedure Pin
Michael Flanakin23-Jan-06 5:54
Michael Flanakin23-Jan-06 5:54 
AnswerRe: GetDate() in Stored Procedure Pin
Qaiser Mehmood Mughal24-Jan-06 3:15
Qaiser Mehmood Mughal24-Jan-06 3:15 
Questionusing ado Pin
yamunasenthilvel23-Jan-06 4:58
yamunasenthilvel23-Jan-06 4:58 
AnswerRe: using ado Pin
S Douglas24-Jan-06 0:53
professionalS Douglas24-Jan-06 0:53 
Questionhelp with deletion and updation with the same code.. Pin
yamunasenthilvel23-Jan-06 2:06
yamunasenthilvel23-Jan-06 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.