For example if you create object that takes five arguments. You could instantiate the object and set all five arguments at once or you could create the object and call 5 different methods (or you would use properties actually), that makes 6 operations when with instantiation it is only one.
Certainly the picture isn't that black and white always for example only certain values could be set when object is constructed and only certain via propeeties (requirements by the business logic).
0 comments:
Post a Comment