Jump to content

Calling a class from another file in a function?


rockinaway

Recommended Posts

  • 2 weeks later...

No you see, I am wroking in a software and everything is handled properly.. is is how it has been done ...

It's still a code smell. Negates the entire reason for having a modular application, but it breaks the capsulation by having a direct and explicit dependency on not only a global value, but also the name of the variable containing that value.

 

It is much better practice to present that value as a parameter to your object.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.