Thread View: borland.public.cppbuilder.oodesign
1 messages
1 total messages
Started by Roger Warren
Fri, 17 Dec 2004 13:36
OO/VCL/Events Design Questions
Author: Roger Warren
Date: Fri, 17 Dec 2004 13:36
Date: Fri, 17 Dec 2004 13:36
47 lines
2647 bytes
2647 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads