model-view-controller pattern solution would be to have the controller create the user instance and then force it to pass the user object to the constructor of the userprofile model class the same problems could arise on the view side of the picture the key thing to remember is that every object should have one responsibility and one responsibility only if it is displaying information to the userit should not do calculations on the informationif it is handling datait should not concern itself with creating missing pieces on the flyand if it is controlling the flowit should not pay any attention to how data is stored or retrieved or how the data is formatted or displayed parting shots the more cleanly you separate the concerns in your objectsand the better you isolate their purposethe easier it will be to maintain your codeupdate itor find and fix bugs one of the most important concepts you should take with you on your journey toward programming mastery is the paradox of the ship of theseus the paradox is stated as suchimagine you have shipand on the ship they have enough lumber to completely rebuild the ship the ship sets outand along the wayeach piece of lumber built into the ship is replaced by some of the stock carried on the ship the replaced piece is discarded by the time the ship reaches its destinationnot single plank from the original ship remains the question isat what point do you have new shipwhen does the ship cease being the ship you set out withwhat does this have to do with programmingyou should build your programs in such way that you can constantly swap out bits of the program without changing any other part of the code every period--depending on the size and scope of your projectthis might mean year or five years or six months--you want to have cycled out all the old code and replaced it with bettermore elegantand more efficient code keep asking yourself how much of pain it will be to replace the part of the code you are currently working on with something completely different if the answer is that you hope such replacement is not needed before you have moved onrip up the code and start over