© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
3 replies
Drama Llama

Splitting a large class and problems with a field needed in multiple classes as a result

So one of my classes got too big, so I decided to split it off into multiple classes. But there is a field containing an object that I will need in multiple classes now.

My study exercises usually focused a lot on not having bidirectional associations, so I assumed that was the preferred way to go about it. But I couldn't work out on how to do this in a way that doesn't feel like a hack or mess at the very least. Right now it still looks somewhat like this:
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Class as a field?
C#CC# / help
3y ago
✅ Nested classes in C# with parent being a generic class
C#CC# / help
13mo ago
Set a class attribute result with a custom attribute
C#CC# / help
3y ago
✅ splitting project into multiple files
C#CC# / help
3y ago