Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6913

Re: Export vs Protect and Access

From "Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Export vs Protect and Access
Date 2014-05-26 22:36 +0200
Message-ID <buhmutFa1jvU1@mid.individual.net> (permalink)
References <19d01048-056a-41f7-93f6-c11362766a35@googlegroups.com>

Show all headers | View raw


Hi Chris,

As Marc wrote, with EXPORT you violate (at least a little) the principle of 
class encapsulation. With properly programmed access and assign methods you 
have a defined interface to the class variables and the possibility to do 
some checking of transferred values. I prefer Marcs method with the 
underscore.

regards
Urs

"CMc" <cmccaul@ruddwisdom.com> schrieb im Newsbeitrag 
news:19d01048-056a-41f7-93f6-c11362766a35@googlegroups.com...
> Finally making the move from 2.7b to 2.8 and am getting a lot of 
> "Access/Assign method has same name as Protected ivar" compiler errors 
> that I need to clean up.  Can someone tell me what's the difference 
> between:
>
> CLASS MyClass
> EXPORT cVar AS STRING
>
> and
>
> CLASS MyClass
> PROTECT _cVar AS STRING
>
> ACCESS cVar CLASS MyClass
> RETURN SELF:_cVar
>
> Is one more efficient, better for memory management, easier to port to 
> Vulcan?  Other than coding style, why should I use one over the other?
>
> Thanks,
> Chris 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Export vs Protect and Access CMc <cmccaul@ruddwisdom.com> - 2014-05-25 16:44 -0700
  Re: Export vs Protect and Access Farid <faridwatson@gmail.com> - 2014-05-25 20:41 -0700
    Re: Export vs Protect and Access CMc <cmccaul@ruddwisdom.com> - 2014-05-26 05:37 -0700
      Re: Export vs Protect and Access Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2014-05-26 15:51 +0200
  Re: Export vs Protect and Access D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2014-05-26 10:17 +0200
    Re: Export vs Protect and Access "Marc Verkade [MITCon]" <marc@mitNOSPAMconDELETE.nl> - 2014-05-26 16:45 +0200
      Re: Export vs Protect and Access D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2014-05-26 17:27 +0200
        Re: Export vs Protect and Access "Marc Verkade [MITCon]" <marc@mitNOSPAMconDELETE.nl> - 2014-05-28 20:47 +0200
  Re: Export vs Protect and Access Massimo Bighelli <info@arcasistemi.it> - 2014-05-26 17:29 +0200
  Re: Export vs Protect and Access "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-05-26 22:36 +0200
  Re: Export vs Protect and Access "Jamal" <someone@example.com> - 2014-05-27 22:09 -0400
    Re: Export vs Protect and Access Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2014-05-28 07:30 +0200
      Re: Export vs Protect and Access "Jamal" <someone@example.com> - 2014-05-28 11:13 -0400

csiph-web