考虑到父子双赢的表单,我们应该在父表单中放入多少代码?
考虑我们有 2 个数据输入获胜表单:form1(父级)和该父级的 form 2 子级。
众所周知,我们可以简单地声明虚拟方法,以便将来可以被任何子级覆盖。
我的问题是如何构建父表单方法的蓝图?我的意思是每个方法都应该是虚拟的?或者什么?
Consider we have 2 data entry win forms : form1 (parent) and form 2 child of that parent.
As all we know, we can simply declare virtual methods in order to be overridden by any child in future.
my question is how to construct blueprint of the parent form methods? I mean every method should be virtual? or what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我觉得如果你有这样的想法,说明你缺乏正确的设计蓝图。
一个好的、可维护的软件由设计文档和许多其他支持文档组成。如果您认为可以从头开始,而不关心实际需要的内容,那么它将变得混乱并且需要大量的重构。
设计一个软件有多种风格。我不确定您选择了哪种方法。
父母应该包含它需要的一切;任何使它坚固的东西。孩子们继承了这些品质。父母不是根据孩子的要求进行编码的。
也许有时必须打扰父母,但仅限一两次。
I feel that if you're thinking this way, you lack a proper design blueprint.
A good and maintainable software consists of design document and many other supporting ones. If you think that you can start from scratch with putting little mind in what is actually required, then it will be chaos and need lot of re-factoring.
There are various styles to design a piece of software. I'm not sure which methodology you have chosen.
A parent should contain whatever it needs; whatever makes it stand robust. The children inherit those qualities. A parent is not coded on the basis what is required by children.
There maybe instances when parent must be disturbed, but then keep it to once or twice only.