Solved

UI seperation from DB-access

Posted on 1998-10-13
4
123 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now