Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rick C. Hodgin
  Where is Rick C. Hodgin?
 Indianapolis
 Indiana - United States
 Rick C. Hodgin
 To: Sithu Kyaw
  Where is Sithu Kyaw?
 Yangon
 Myanmar
 Sithu Kyaw
 Tags
Subject: RE: Error instantiating class
Thread ID: 365148 Message ID: 365238 # Views: 28 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Saturday, December 22, 2012 5:29:00 PM         
   


> What I want to do is very simple. I just want to make my own version control on my classes.
> Here is a simple scenario:
> 1. I'm using my class first version "mycontrols-1.0\mycontrols.vcx". The version numbering is a part of the folder name, not on the vcx file.
> 2. MyApp1 use "mycontrols-1.0"
> 3. Now, I'm creating MyApp2 using "mycontrols-1.0".
> 4. But in the middle of development, I found that I have to amend/enhance the class library to use in MyApp2.
> 5. Thus, I changed the folder name "mycontrols-2.0".

Here's the problem. You don't need to do what you're doing here. Instead, create a new class which uses as its parent the original class. This allows you to keep the original code and only apply whatever changes you'll need to make to what is then the derived class, for that one application. The parent / base class remains the same with the core functionality. You can use DODEFAULT() on the child to call the original code, and then modify slightly for the needs of your new app. The variations you need which are specific to a later application are then only applied to the derived class, while the base class, the original class, remains the same.

Using this system, everything works fine in just one directory.

Another possibility is to create a copy of the class object and give it another name in the same class file.

Lots of possibilities to accommodate what you're doing. You just need to learn them.

> I has been scratching my head on this issue since I started
> to use VFP.

You should not always try to get things to work the way you think they should work, but rather be willing to learn how they work and operate within that system. Some things in VFP are very frustrating and deserve to be changed. This class naming convention part is not really one of them. VFP is very good at resolving and fixing class names.

> But I have been working with this successfully in my open
> source web development.

With each different program a potentially different set of rules...

Best regards,
Rick C. Hodgin

ENTIRE THREAD

Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:15:28 PM
RE: Error instantiating class Posted by Rick Hodgin @ 12/21/2012 4:28:01 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:46:11 PM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 4:50:38 PM
RE: Error instantiating class Posted by Rick Hodgin @ 12/21/2012 4:50:41 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/21/2012 4:59:25 PM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 5:08:58 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 5:31:59 AM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 6:09:59 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 7:11:06 AM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 7:43:49 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 10:40:17 AM
RE: Error instantiating class Posted by Rick Hodgin @ 12/22/2012 5:29:00 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/23/2012 6:30:09 AM
RE: Error instantiating class Posted by David Mustakim @ 12/23/2012 10:46:05 AM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/23/2012 11:37:37 AM
RE: Error instantiating class Posted by Samir H. @ 12/23/2012 1:31:38 PM
RE: Error instantiating class Posted by David Mustakim @ 12/23/2012 6:44:38 PM
RE: Error instantiating class Posted by David Mustakim @ 12/22/2012 6:25:48 AM
RE: Error instantiating class Posted by Tamar Granor @ 12/21/2012 11:01:38 PM
RE: Error instantiating class Posted by Sithu Kyaw @ 12/22/2012 5:13:38 AM
RE: Error instantiating class Posted by David Mustakim @ 12/21/2012 4:48:39 PM
RE: Error instantiating class Posted by Stefan Wuebbe @ 12/23/2012 11:02:32 AM