This content has been marked as final. Show 3 replies
Why do you think a MXML component should be private by default?
Because its best practice for OOP. Better enforces loose coupling
Just noticed this and I think he may have a valid point here. But as well as reducing coupling the term I'd use to make this argument is encapsulation.
There's no way AFAIK to make MXML sub components invisible to higher level components. This can sometimes reveal things internally that you don't want messed with, within a custom component. If you have a custom component that only requires one property be set to configure it properly, you don't want to be revealing all these extra sub-components just because they had to have ids assigned to them inside the custom component.
This may be a headache for backwards compatibility, for anyone who has assumed these components would be public by default, but a simple "scope='public'" attribute should fix that. But even having them public by default, and allowing us to set their scope to private would be helpful at times.