Table of contents - 60 tips on OOP book
3 pages
Publié par
sgganesh
Copyright :
Tous droits réservés
TABLE OF CONTENTS
Class Design
1.
Provide consistent and intuitive class interface.
5
2.
Provide common properties of classes in a base class.
9
3.
Do not expose implementation details in the public interface of the class.
12
4....
[Plus]
TABLE OF CONTENTS
Class Design
1.
Provide consistent and intuitive class interface.
5
2.
Provide common properties of classes in a base class.
9
3.
Do not expose implementation details in the public interface of the class.
12
4.
Consider providing helper classes while designing large classes.
14
5.
Keep the data members private.
18
6.
Provide lowest possible access to methods.
23
7.
Strive for loose coupling between classes.
26
8.
Beware of order of initialization problems.
29
9.
Write unit tests for classes.
31
10.
Avoid low-level code.
34
Object Creation and Handling
11.
Avoid calling virtual functions in constructors.
37
12.
Consider providing factory methods.
43
13.
Make constructor private if there are only static members in the class.
45
14.
Avoid creating unnecessary temporary objects.
47
15.
Prefer creating immutable objects.
52
16.
Consider creating and using null objects.
54
17.
Provide special objects with read only access in the class itself.
56
Overloading
18.
Overload operators only if it is natural and improves readability of code.
60
19.
Overload symmetrical operators or family of operators.
63
20.
Overload functions only if it is intuitive and unambiguous to users.
65
21.
Overload functions only if the functions do semantically the same thing.
69
Inheritance
[Moins]
Insérez un miniCalaméo dans votre page Web ou votre blog
Tags
avoid,
class,
classes,
code,
creating,
design,
functions,
inheritance,
interface,
members,
methods,
objects,
operators,
overload,
prefer,
provide,
providing
Sites renvoyant vers cette publication (1)