Solved

UI seperation from DB-access

Posted on 1998-10-13
4
128 Views
Last Modified: 2010-04-06
Hi,

We are at the start from a new project. For the maintenance of the system we decided that the coupling between the user interface and the database access should be as low as possible.
A database module written to access a certain kind of data like customer information should easy be transferable to another part of the application. How do you setup this, how do you get all your business logic in the database modules and how do you avoid database logic in forms!!

What tips can you guys give me on this topic?
What about OO in database modules?


0
Comment
Question by:castelli
  • 2
  • 2
4 Comments
 

Author Comment

by:castelli
ID: 1342744
Edited text of question
0
 
LVL 4

Accepted Solution

by:
dwwang earned 160 total points
ID: 1342745
You can just do any OO programming in data-modules, no problem.
For your question, below is an example(I usually use in our project):

type TMyDataModule=class(TDataModule)
public
function myBusinessfunc(...):retType;
end;

var
myDm:TMyDataModule;

impementation
function myBusinessfunc(...):retType;
begin
     //Access Database ....
end;

In other forms, just call myDM.myBusinessfunc;

That will enclose all your Data Logic in DM.

0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342746
Are you still there?
0
 

Author Comment

by:castelli
ID: 1342747
Thanks , We were working out different scenario's, Sorry about the long waiting time...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question