Can anyone explain decoupling to me please?
Hello,
I have searched throughout various programming webpages on a decent answer for the use of decoupling between scripts and cannot find a good answer on what decoupling is and how it works. Can anyone explain, pref with examples, please?
Are you making a game? Are you having any problems? Did someone say "decoupling" would solve one of those problems?
Perhaps not the official definition, but I like to think of "Decoupling" as a way to allow two or more programs (sub-programs, dll's, classes.. whatever) to work together, AND ALSO work WITHOUT the others.
This answer is an example of decoupling: https://answers.unity.com/questions/1347169/how-to-conditional-use-of-unityeditor-in-dll.html This example allows one's program to use the UnityEditor.DLL, if it's available, but will also be able to work without error (though obviously in a more limited way) even when that DLL is NOT present.
RE: "official definition": Good point. Decoupling is obviously removing coupling, so start there. Searching leads to "tight coupling," narrowing interfaces, program$$anonymous$$g to an abstraction, coherence&cohesion and other software engineering topics. Lots of official definitions in there.
Your answer
Follow this Question
Related Questions
Unity HUD Tracking and Target Selection 0 Answers
Remove connection between lists or arrays 3 Answers
Climbing wall Script? 2 Answers
Problems with loops 2 Answers