creating classes

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

When have a class, but need some info that is contained in other class, is
it worth the overhead to instantiate both objects if you only need 2
properties, or let those other properties piggyback on the first class which
would make it kind of ugly.

thanks!
 
Based on SRP (Single Responsibility Principle) you should have it in only
one class.

Hope this helps...

Frisky
 
Do not worry about the overhead of instantiating an object. Where
efficiency is concerned you probably have far bigger fish to fry than
that.

Could you given a concrete example? It always helps to hear the problem
in real-world terms.
 
Back
Top