Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Object Oriented program samples

Posted on 1998-11-25
3
Medium Priority
?
161 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
[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
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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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