Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JVP's mid-tier inheritance challenge
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00324138
Message ID:
00325002
Views:
34
>Tell you what, how about you folks give me a small problem to solve. The problem should be one where if you solved it in VFP, you would use inheritance. Then, I will take a stab and solve it in VB, all with out inheritance, and all without copying and pasting code...

Thank you John! This should be interesting. =D)

I think a good example would be rolling your own simple business object (no 3rd party tool used where your drawn into a formal design). I would think this would be an area where VFP developers who rely heavily on inheritance would easily get into trouble over the course of time...

Say I have my custom business object subclassed from a VFP base class that performs your basic transaction for tableupdate(). Now let's pretend for a minute I'm not smart enough to setup hook methods before and after my transaction method for the sake of an easy example here. So from my basic business object, I now have to subclass and add a LookupValue() method to check a reference table before proceeding with the transaction. A few apps down the road, and now I need a business object that adds en entry to an audit trail table after each transaction completes successfully. So I add a third level subclass, one which calls a MakeAuditTrail() after the transaction.

Does that work for you as an example to dispel the VB copy paste myth?
Roxanne M. Seibert
Independent Consultant, VFP MCP

Code Monkey Like Fritos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform