Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OO/VCL/Events Design Questions

0 views
Skip to first unread message

Unknown

unread,
Dec 17, 2004, 8:36:02 AM12/17/04
to
Hello,

I am about to embark on tidying up a medium sized project. I want to
include some common useful classes such as Transaction,
TransactionDetail, Customer (etc...). The project is a 2-tier
client/server application that uses ADO components to access MS-SQL.

I could be wrong as I haven't done this before, but I have approached
this task by looking through the (undocumented) code and documenting
(what I think) could be represented by classes.

Question 1: The TMainDataModule in the existing application has a
TADOQuery *qCustomer. This has 100+ fields. In the customer class,
would I:

a) Leave qCustomer on the main DataModule and then add a stack of
private members to my Customer class and then populate the private
members using some method, perform whatever operations need to be
performed on the private members, and then provide some method for
writing these back to qCustomer?

b) Include a private member in the Customer class (TADOQuery
*qCUstomer) and then copy/clone the data from the qCustomer that sits
on the main DataModule?

c) Include a private member that points to the qCustomer that sits on
the main DataModule?

d) Use some other design technique/architecture?


Question 2: How do I deal with things like the AfterScroll event of a
TADOQuery. For example, qCustomer::AfterScroll in the original
application points to a method that displays: "Customer X of Y" in a
TStatusBar on a form.


I have read up on OO practises and principles, but just don't know
where to begin with this. I don't want to jump in head first without
first hearing from someone with real world experience of using the VCL
with OO for something similar.

Any help/insight into using VCL within OO/classes (or some recommended
alternative) would be really appreciated.

Thanks,
Roger.

0 new messages