Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Andy Kramek
  Where is Andy Kramek?
 Westminster Circle, Akron
 Ohio - United States
 Andy Kramek
 Tags
Subject: RE: formset disliking by seniors
Thread ID: 123907 Message ID: 124791 # Views: 53 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Wednesday, March 07, 2007 3:44:54 PM         
   


> Hi Khurram
>
> > You are telling about public memory variables are also not a good choice for new one then the persons who swithed from FPD26 to VFP9 what they do ?
> > What is the alternative of public memory variables ?
>
> An afterthought! This Forum is a good example of an Object Oriented Environment and illustrates the difference between OOP and Procedural Programming very nicely. Think about it...
>
> You have a question. You also know that someone knows the answer but you don't know who. How can you find the answer to your question?
>
> Well, first you could decide who YOU think might know the answer, and ask them directly. This is the 'procedural' approach and suffers because you don't really know who to ask first, and you can't ask someone else until the first person has answered. So you have to compile a list, then work through it until maybe you get lucky - after all there is no guarantee that any person who knows your answer is on your list!
>
> A better solution is to post a question on this forum. The difference is that now you are shifting the responsibility from yourself to anyone who reads your message. If the reader knows the answer, they can reply - not only do you not have to know WHO to ask, you may even get several replies and maybe even from a person who you would never have thought to ask at all.
>
> This is what, in OOP is called the "Broadcast" approach. Each reader (object) either responds to the question (the request) or doesn't. You do not need to know, or care, which reader (object) will respond - providing that you get the right answer (result)!
>
> A good example of a VFP Broadcast is the "ThisForm.Refresh()" call. This does not refresh each object on a form. What it does is tell each object to Refresh itself! The difference is subtle, but crucial. In accordance with the rules of OOP and encapsulation, the form must not mess with the internal working of any other object, so instead it calls on the object and tells it WHAT it wants the object to do, but not HOW to do it.
>
> Now where does the public variable fit into all this? Well that is where, in the procedural world you would have to store each person's answer so that the next person asked could see it. In the OOP world, you see all the answers (each responder posts their own ) and you only need a LOCAL variable (you) to store the answer.
>
> Does that make things better, or worse ?
>
> Regards
> Andy Kramek
> Microsoft MVP (Visual FoxPro)
> Tightline Computers Inc, Akron Ohio, USA

Good analogy - my rating to you.

I am not sure that for a newbie to OOP it would make a great deal of sense, but to someone with a cursory understanding, it is a great analogy.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)



COMPLETE THREAD
formset disliking by seniors Posted by Khurram Tahir @ 3/1/2007 6:43:35 AM
RE: formset disliking by seniors Posted by Boudewijn Lutgerink @ 3/1/2007 12:29:03 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/1/2007 1:18:27 PM
RE: formset disliking by seniors Posted by Ken Murphy @ 3/1/2007 1:29:17 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/1/2007 3:42:43 PM
RE: formset disliking by seniors Posted by Boudewijn Lutgerink @ 3/1/2007 4:53:07 PM
RE: formset disliking by seniors Posted by Khurram Tahir @ 3/2/2007 12:26:17 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/2/2007 1:10:29 PM
RE: formset disliking by seniors Posted by Steve Bloodsworth @ 3/2/2007 4:34:53 PM
RE: formset disliking by seniors Posted by sudhir uppal @ 3/14/2007 3:11:05 PM
RE: formset disliking by seniors Posted by Boudewijn Lutgerink @ 3/6/2007 7:45:34 AM
RE: formset disliking by seniors Posted by Khurram Tahir @ 3/9/2007 6:32:59 AM
RE: formset disliking by seniors Posted by Khurram Tahir @ 3/16/2007 8:47:40 AM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/16/2007 11:03:06 AM
RE: formset disliking by seniors Posted by Ronan Masangcay @ 3/14/2007 5:03:16 AM
RE: formset disliking by seniors Posted by Pete Sass @ 3/6/2007 4:38:13 AM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/6/2007 12:41:23 PM
RE: formset disliking by seniors Posted by Pete Sass @ 3/6/2007 7:26:57 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/6/2007 8:09:12 PM
RE: formset disliking by seniors Posted by Pete Sass @ 3/8/2007 12:13:28 AM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/8/2007 11:55:13 AM
RE: formset disliking by seniors Posted by Pete Sass @ 3/8/2007 2:01:20 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/8/2007 3:05:22 PM
RE: formset disliking by seniors Posted by Ken Murphy @ 3/8/2007 3:24:32 PM
RE: formset disliking by seniors Posted by Pete Sass @ 3/8/2007 4:27:06 PM
RE: formset disliking by seniors Posted by Ken Murphy @ 3/6/2007 8:42:04 PM
RE: formset disliking by seniors Posted by Khurram Tahir @ 3/7/2007 1:12:43 PM
RE: formset disliking by seniors Posted by Ken Murphy @ 3/7/2007 1:26:22 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/7/2007 2:33:34 PM
RE: formset disliking by seniors Posted by Andy Kramek @ 3/7/2007 3:07:13 PM
RE: formset disliking by seniors Posted by Ken Murphy @ 3/7/2007 3:44:54 PM