内部应用程序-为什么不公开所有内容? [英] Internal applications - why not make everything public?
问题描述
我为什么不应该在我们的Intranet报表应用中将所有内容都标记为公开?
Is there a reason why I should not be marking everything as public in our intranet reporting app?
没有一个外部合作的公司可以访问此代码-我们有大约20个项目-大部分都很具体.
No one outside out co will ever have access to this code - we have about 20 projects - mostly small and specific.
我们真的有理由要对公共事物以外的事物进行标记吗?
Is there really a reason why we should be marking things anything other than public?
我对此有自己的想法,我想忽略掉,因为我希望这是公正的.
I have my own thoughts on this which I'm trying to omit as I want this to be unbiased.
(我对标题进行了小幅修饰)
(I have sexed up the title slightly)
推荐答案
查找封装和/或信息隐藏" :
在面向对象的编程中,信息隐藏(通过类型嵌套)通过将代码对不确定实现(设计决策)的依赖性转移到定义明确的接口上,从而降低了软件开发风险.接口的客户端完全通过它执行操作,因此,如果实现发生更改,则客户端不必更改.
In object-oriented programming, information hiding (by way of nesting of types) reduces software development risk by shifting the code's dependency on an uncertain implementation (design decision) onto a well-defined interface. Clients of the interface perform operations purely through it so if the implementation changes, the clients do not have to change.
如果您将每个班级的成员都标记为公开,则意味着一场维护噩梦,未来的开发人员(包括您自己)将不确定班级的哪些部分是永久性的(合同),哪些是永久性的纯粹的实现细节.
If you mark the members of every class as public, you're making for a maintenance nightmare where future developers (including yourself) will be unsure on which parts of the class are meant to be permanent (the contract) and which are purely implementation details.
这篇关于内部应用程序-为什么不公开所有内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!