Jump to content

Sending references OOP


sircatsquid
 Share

Recommended Posts

I've already got a solution for this but might get something I haven't thought of.I'm starting to have a lot of reference variables to send to each class what is the best practice here?I solved this with a resource class, that I send instead with all the references I need to send. Any other suggestions on this problem is appreciated. But I think this will work just fine, just curious if there is other ways.

Link to comment
Share on other sites

One way is to make a static class which has all of your properties. You won't need to pass it around or specify as global or anything, it will always be available in any scope.
Yeah I did that at first but it didn't feel right also it's considered bad practice to use static like that. But yes one way of doing it.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...