Talk:Getter and setter policy

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
Line 7: Line 7:
 
If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --[[User:BenMcDonald|BenMcDonald]] 06:44, 28 July 2009 (UTC)
 
If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --[[User:BenMcDonald|BenMcDonald]] 06:44, 28 July 2009 (UTC)
  
sure there would be exceptions for example dealing with a collection. Thus I used 'ideally' --[[User:AlexGee|AlexGee]] 09:45, 28 July 2009 (UTC)
+
:sure there would be exceptions for example dealing with a collection. Thus I used 'ideally' --[[User:AlexGee|AlexGee]] 09:45, 28 July 2009 (UTC)
 +
 
 +
I know it would not be very nice design, but there is nothing stopping a developer from adding additional functionality to a getter/setter. If we want to stop that from happening, possibly this should also be included in the policy. --[[User:Matthew Harward|Matthew Harward]] 21:04, 28 July 2009 (UTC)

Revision as of 21:04, 28 July 2009

Don't tell me everyone agrees where is the fun in that?

I just have to completely agree with the first paragraph. I also try to always use this->FunctionName() to make the difference between internal and external function calls clear. Python, for instance, enforces such a syntax ( self.FunctionName() ). --TobiW

Very nice little style guide there, I would back that 100% --AlexGee 02:09, 28 July 2009 (UTC)

If the object has to call its getters and settings to change its own variables then changes to the variables internally would be subjected to the same constraints as calls through the public interface. This also would mean that internal calls would always have the same constraints as public calls. Would you want this? I mean might there be exceptions to this rule? --BenMcDonald 06:44, 28 July 2009 (UTC)

sure there would be exceptions for example dealing with a collection. Thus I used 'ideally' --AlexGee 09:45, 28 July 2009 (UTC)

I know it would not be very nice design, but there is nothing stopping a developer from adding additional functionality to a getter/setter. If we want to stop that from happening, possibly this should also be included in the policy. --Matthew Harward 21:04, 28 July 2009 (UTC)

Personal tools