Article View: borland.public.cppbuilder.oodesign
Article #126OO/VCL/Events Design Questions
From: 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.
Technical Details
Message-ID:
<41c2e0c2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10db1e,743d0296b4fe9414,start X-Google-Attributes: gid10db1e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Roger Warren" <> Subject: OO/VCL/Events Design Questions Newsgroups: borland.public.cppbuilder.oodesign Organization: Warren Systems Limited User-Agent: XanaNews/1.16.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 81.137.14.60 Message-ID: <41c2e0c2@newsgroups.borland.com> Date: 17 Dec 2004 05:36:02 -0800 X-Trace: newsgroups.borland.com 1103290562 81.137.14.60 (17 Dec 2004 05:36:02 -0800) Lines: 47 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail