Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One or more classes per ClassLib
Message
From
29/11/2001 10:26:17
 
 
To
29/11/2001 08:37:37
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00587173
Message ID:
00587473
Views:
32
This message has been marked as a message which has helped to the initial question of the thread.
Michael,

Yes, using classes to handle business & application logic is a great idea. I only asked you the question because I wasn't sure if you ever got your class working the other day in a PRG file.

First of all, let's limit this discussion to non-visual classes, like you are currently dealing with. When non-visual classes are stored in a PRG file, they have all of the same benefits of those stored in VCX files. The primary differences are in how they are stored and how you actually enter and manage your code.

When a class (non-visual) is stored in a PRG file, you still create an object the same way...using CREATEOBJECT() or NEWOBJECT(). Also, you can create a COM object in a PRG just as easily as in a VCX, using the OLEPUBLIC keyword.

Using .prg or .vcx files is really a matter of preference. I prefer to put them in a program file, because I feel like I have a better overall view of what I am doing. Also, when I am testing, I can put the test code in the same program file, outside of the class definition (like we were trying to show you how to do the other day). So, I can sit in one PRG file and work on the class and test it without closing the file (by hitting CTRL-E to run the test code I put at the top). Finally, VFP7 has a new dockable window that shows you all of the functions (and class methods) in a PRG file.

Maybe someone will jump in and give the reasons they prefer to store non-visual classes in class libraries...the only reason I keep emphasizing the words "non-visual" is to prevent people from saying how thay want to be able to drop their button classes directly onto forms. *grin*

HTH,

>I'm not really sure. I am trying to put together a generic template to be used by several of our customers and I thought this would be a good way to develop a front end, back end and utilize com components to handle the table updates. That way when we have a customer who's needs vary from the others all we have to do is change the interface (front end). I thought this would be handled better in a network environment using .vcx components. I would gladly listen to any suggestions on other ways to do it and advantages/disadvantages of vcx vs. prg.
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform