Solved

Object Oriented program samples

Posted on 1998-11-25
3
155 Views
Last Modified: 2013-11-23
I had been writing an MIS database program which involves customer information entry, deletion, search...etc. Now, i am told to re-arrange this program by using object-oriented logic. With that in mind i determined some objects. But the objects i chose are barely the tables i have. i am not sure about this to be correct. I need some examples of object-oriented programs in Delphi and advice on how to implement this situation in object-oriented manner.  First i said there is a manager which manages works around, a screen object which would write on screen, an I/O object which will do the I/O works (read/write database) but... that doesn't make sense! Delphi already have objects for screen TScreen, TForm and for databases TQuery, TTable. Why do i write these objects again? I need some examples in Delphi written with object-oriented logic.
Any help is appreciated.
0
Comment
Question by:Cuneyt
3 Comments
 
LVL 5

Expert Comment

by:scrapdog
ID: 1347824
Almost all Delphi programs are object-oriented, at least object based.  If you are already using TForm, TScreen, TQuery, etc. you are already using object-based programming.  By object-oriented logic, do you mean that you want to make your own objects/components?
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1347825
Perhaps you should think of your application as not object-oriented (which it already is, because you're using TQuery, TTable, etc.), but instead think of transactions.

A transaction can be thought of like an ATM bank machine transaction. You want to withdraw money or transfer money. But the task of transferring money may require several TQueries or TTables. In this sense, a transaction is an operation on several objects and the transaction itself is an object. Is this the idea you were looking for?

The other nice things about transactions is roll-back. The idea here is that during the process of updating several database tables for the ATM transfer, something terribly wrong can happen. If an application was designed correctly (as most bank ATMs are), then you can be sure that the transaction either happened completely (i.e. no extra money produced by adding to one account and not subtracting it from another) or nothing happened at all.

While using objects to create programs are great. It requires quite a bit of design work to filter out the important objects and how to create them correctly.
0
 

Author Comment

by:Cuneyt
ID: 1347826
I already know that Delphi is an Object-Oriented programming language and all programs i write in Delphi is based on objects. But i had written a database program in Delphi. And now i am told to rewrite it with the object oriented manner. And i am looking for examples.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi selector screen 2 78
select query - oracle 16 100
Firemonkey DbLookupComboBox equivalent ? 2 47
firemonkey keyboard covers the controls 1 25
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

770 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