Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Customizing code

$
0
0
Re: Customizing code
Web Connection 5.0
Re: Customizing code
03/13/2012
01:15:01 PM
3GD0SEIRB Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None

Just sublcass wwBusiness and then use that as your base class for whatever business objects you create. Don't change wwBusiness.

+++ Rick ---



Dear Rick,
I would like, for example, to change Opend method of wwBusiness class, so what I have to do?
I UNDEFINE and DEFINE into WCONNECT_OVERRIDE.H file.
Do I write the new Open method in MyAppProcess.prg?
Open method is only a part of the wwBusiness class, so must I write the full wwBusiness class code in MyAppProcess as MyBusiness class?
Thank you very much for patience.


You should never modify the base classes as they WILL get overwritten in updates. Whenever possible subclass any Web COnnection classes and they use those sub-classes instead. Most Web Connection classes are defined in WCONNECT.h as #DEFINE statements. For example:

#DEFINE WWC_RESPONSE wwResponse #DEFINE WWC_RESPONSEFILE wwResponseFile #DEFINE WWC_RESPONSESTRING wwResponseStringNoBuffer #DEFINE WWC_RESPONSEASP wwASPResponse

To change any of those classes create your subclass and then add the following into WCONNECT_OVERRIDE.H:

#UNDEFINE WWC_REQUEST #DEFINE WWC_REQUEST myRequest #UNDEFINE WWC_WWPDF #DEFINE WWC_WWPDF wwXFRX

Then if you need to explicitly instantiate these classes use:

loPdf = CREATEOBJECT([WWC_WWPDF])

The #DEFINEs are important because they are used internally in Web Connection to instantiate objects used inside of the frameowrk where you can control the object creation. In MOST (but not all) places Web Connection uses the above syntax to create objects.

+++ Rick ---


Dear Rick,
by developing my new application sometime I have to customize original Classes: I comment original code, then I write my customized code.
However I fear that future upgrades could overwrite original Classes and so I could lose my customizations.
Please is there any better way to customize?
Thank you very much again for your great software and for your precious support!





Rick Strahl
West Wind Technologies

Making waves on the Web

from Maui, Hawaii

Viewing all articles
Browse latest Browse all 10393

Trending Articles