If things are unlikely to change then it's probably not worth the extra effort.
If you decide to, though, the question is whether new classes would implement all or just part of the functionality. For example, do they share backend storage, so all would need to be updated at once (in which case there is no point in splitting), or do they relate to entirely separate concerns in which case splitting (as suggested by @GarethOwen) is probably the way to go.
发布评论
评论(2)
您确定所有这些函数都属于同一个 X 类吗?考虑将不同的功能分成不同的类:
http://en.wikipedia.org/wiki/Low-Coupling_/_High- Cohesion_pattern
但是如果不知道 X 的功能是什么,就很难提供进一步的帮助。
Are you sure all these functions belong to the same class X? Think about separating different functionality into different classes:
http://en.wikipedia.org/wiki/Low-Coupling_/_High-Cohesion_pattern
But without knowing what the functions of X are it is difficult to help further.
如果事情不太可能改变,那么可能不值得付出额外的努力。
但是,如果您决定这样做,问题是新类是否会实现全部功能或仅实现部分功能。例如,它们是否共享后端存储,因此所有内容都需要立即更新(在这种情况下,拆分没有意义),或者它们是否涉及完全独立的问题,在这种情况下,拆分(如 @GarethOwen 所建议的)是可能是要走的路。
If things are unlikely to change then it's probably not worth the extra effort.
If you decide to, though, the question is whether new classes would implement all or just part of the functionality. For example, do they share backend storage, so all would need to be updated at once (in which case there is no point in splitting), or do they relate to entirely separate concerns in which case splitting (as suggested by @GarethOwen) is probably the way to go.