Solved

UI seperation from DB-access

Posted on 1998-10-13
4
130 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 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