我的班子是我写的单项活动,其中包括公开的课堂。 单轴心中,如事件、警报等部件的种类非常复杂,因此,让它们公开使用方案其他部分使用的课堂是明智的。
我已读过,开设公共开门课是不良方案规划的迹象。 为什么是坏的,什么时候是适当的开门课?
我的班子是我写的单项活动,其中包括公开的课堂。 单轴心中,如事件、警报等部件的种类非常复杂,因此,让它们公开使用方案其他部分使用的课堂是明智的。
我已读过,开设公共开门课是不良方案规划的迹象。 为什么是坏的,什么时候是适当的开门课?
这是所有IMHO,但来自大约15年的对其他人的创造进行分析:
如果封门课是私人的,并且不受到装饰类别公共接口的影响,那是适当的。
例如,一个联系名单类别将有一个内部公布的、与执行内部具体相关的、但不会接触相关名单类别消费者的链接清单。
否则,我不会再说一遍,因为它只是增加了不必要的复杂性。
举例来说,如果一Cal事件类别暴露的话,我会改变你的所有阶层。
In C#, I know that I can overload the constructor for a class by specifying it in the body of the class: public class MyClass() { public MyClass(String s) { ... } } This overrides the default ...
I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?
While designing ORM, what is the best approach to represent the relationship, performance-wise? I mean, out of the following two, which approach is best considering performance? class Employee { ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...
I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...
I was wondering what is the best practice re. passing (another class) amongst two instances of the same class (lets call this Primary ). So, essentially in the constructor for the first, i can ...
A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...