Flint Particle System Forum - Private to Protected ?!2011-12-12T00:18:43+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Private to Protected ?!http://flintparticles.org/forum/comments.php?DiscussionID=30&Focus=135#Comment_1352008-05-15T13:56:30+01:002008-05-20T10:04:29+01:00axel012345http://flintparticles.org/forum/account.php?u=24
Hi everybody :)
Just to know if we can suppress private argument and function and replace all by protected , like this we can extends.
Thanks of your answer
Just to know if we can suppress private argument and function and replace all by protected , like this we can extends.
Thanks of your answer]]>
Private to Protected ?!http://flintparticles.org/forum/comments.php?DiscussionID=30&Focus=140#Comment_1402008-05-19T15:33:24+01:002011-12-12T00:18:43+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
I've tried to give safe access to everything - either through protected properties or through getter/setter pairs.
Where I've used getter/setters it's usually because I want to allow public ...
Where I've used getter/setters it's usually because I want to allow public access, or because the setter needs to do more than simply set a value. For example, in the ApproachNeighbours action, there are two mutually dependent private properties - _maxDistance and _maxDistanceSq. the latter is for optimizations and should always be the square of the former. By having a getter/setter pair for access to _maxDistance, I can ensure that _maxDistanceSq is always correct. If I make the two properties protected, it's necessary for other developers to know how the class operates internally and keep the two values in sync. I don't consider that good practice.
I've looked through the codebase and identified a number of properties that were obscured for inheritence - these now either have getter/setters or are protected instead of private. This does not mean I think it's now perfect - please let me know if you either disagree with the policy I outline above or if there are any properties you need access to and currently can't access, either directly or through a getter and setter. I want you to be able to extend any class. The changes are checked in to SVN.]]>
Private to Protected ?!http://flintparticles.org/forum/comments.php?DiscussionID=30&Focus=154#Comment_1542008-05-22T08:46:51+01:002011-12-12T00:18:43+00:00axel012345http://flintparticles.org/forum/account.php?u=24
Hi Richard :)
I understand your point of view, but for a framework with many people must be open , some of them will want to have access to these property for many reason no rewrite all , ...
I understand your point of view, but for a framework with many people must be open , some of them will want to have access to these property for many reason no rewrite all , because they have understand your code and getter setter , some not. In more to protect the relation between two properties, you can comment and explain, people that extend will read first, and try to do what is the best.
In my case without speak about action private problem , i have do my own Emitter and my own renderer for bitmap and transform these things into protected : BitmapRenderer : f : createBitmap p: var _preFilters:Array; var _postFilters:Array; var _colorMap:Array;
Emitter : f : createParticle
Thanks to look at it :) .]]>
Private to Protected ?!http://flintparticles.org/forum/comments.php?DiscussionID=30&Focus=160#Comment_1602008-05-23T08:27:14+01:002011-12-12T00:18:43+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
I've changed those from private to protected.
Private to Protected ?!http://flintparticles.org/forum/comments.php?DiscussionID=30&Focus=207#Comment_2072008-06-09T14:21:09+01:002011-12-12T00:18:43+00:00axel012345http://flintparticles.org/forum/account.php?u=24
Thanks :D nice now ^^