Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes! Classes! What is Classes!

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
Hi all - little Star Trek - "Spock's Brain" reference there.

Is the any book/website that is available to learn how to use classes?

Any help would be appreciated.

Thanks.
 
If you agree, that a very generic class does make sense for data access, does the login form make use of that class or does the login form have it's own implementation of data access?

Bye, Olaf.
 
Fro what it's worth, my solution is to use my Manage Users class for all the behind-the-scenes stuff (like checking the user's password), and using the Login form to provide a user interface for that class. The name of the Login form is a property of the class.

That way, all the processing is generic and re-usable, but I can provide a different UI for different applications.

Anthony, you wrote:

I do not have to stop and type a user name/password over and over and over again as I work on new code.

I have a #DEFINE at the top of my main program that says: If running in the development environment, skip the login form; log me in automatically with a pre-defined user name and password. If running as an executable, always go through the full login procedure.

In the exceptional case where I want to actually test the login procedure, I clear the #DEFINE. Most of the time, I never see the login form during development. It saves a huge amount of time over the course of a year.

What do other people do in that regard?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Geoff: I ask, if you use the data access class in login, because once you start classes for one aspect, in the normal case you would also do so for other things, like internationalisation, you start developing an OOP framework quite automatically, if you do things consitently.

You seem to focus a lot on the aspect of reusability. There are many aspects of OOP and focusing on just one of them you don't get the grip.

Mike,

In regard how to skip the login during development and testing:
a) I actually can initialise the framework (in short a goApp object) without starting the app, so the framework initialisation is seperated.

b) If testing the app GUI, I actuall can display the login and just make the passwort optional, that is I can choose or enter the user I want to be and test with his/her application permissions without knowing or entering the password.

c) I can switch in a mode the Windows Account name specifies my application account, as the applilcation user data is relating to the windows account name. In that modeI autologin as me.

Actually being able to test single aspects and modules and classes in the non GUI mode is saving more time than avoiding the login dialog. Often enough some form you want to test is not directly available, so you'd need several steps in the gUI to get where you want to test. That is contraproductive.

Bye, Olaf.
 
Olaf,

I agree that those are also good ways of avoiding having to log in. I suppose there isn't a single correct method.

The point is to do something. I'm always surprised when I see an experienced developer test his application, and laboriously enter a user name and password every time.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 

I use _vfp.startmode in my code to distinguish between development and production so there is no need to modify code when building the executable.




 
My dev environment creates a uniquely-named public variable to automatically log in during routine testing, if the variable is found and set a certain way.

However, sometimes I need to log in as an actual user (to test access restrictions for example). Being able to CLEAR ALL before running bypasses the auto-login.

You say neither, I say neither. ::shrug:: There's more than one way to skin this cat. ;-)
 
Actually, I say neither as well <g>.

But, yes, your're right Dan. I'm not advocating any particular way of doing it. I just raised the point about bypassing the login as an example of the earlier discussion about classes.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top