-
내일배움캠프 13일차 TIL - 모듈화와 커플링 리마인드Misc/오늘 알아낸 것 2023. 8. 20. 20:00
굳이 쓸때없이 모듈화해서 쓰는거 같지만 현재 작성하고 있는 Core 클래스의 구조는 다음과 같다
Core는 모듈 클래스를 담고있는 컨테이너 클래스로 쓰고 있다
하지만 급하게 한번 후려갈겨서 그런지 원래 목적과 무색하게 모듈끼리의 커플링이 발생하게 되었다
그래서 리마인드 할겸 TIL 주제로 삼게 되었다
SceneModule.LoadScene()에서 ResourceModule과 커플링이 이렇게 발생했는데
이걸 원래 목적에 맞게 바꿔보자
일단 Core에 public으로 열어놓은것부터 바꿔야될거같다
사실 이렇게 열어둔게 코드를 작성할때 밑에 우르르르 뜨는게 싫어서 기능별로 나눠놓고 쓸려고 했었다
하지만 지금은 이렇게 한번 바꿔보자
일단 public을 다 때버리고 모듈을 private으로 숨겨놓고 컨테이너에서 해당 기능을 작성했다
이렇게하면 SceneModule과 ResourceModule간에 커플링이 사라져서 모듈화라는 본래의 목적을 달성할수있게 된다
솔직히 Core에서만 쓸 클래스라 이 짓거리가 의미가 없는데 심심했나보다
나같이 뒤틀린 코드를 작성하는 놈이 되지말도록 하자
'Misc > 오늘 알아낸 것' 카테고리의 다른 글
내일배움캠프 15일차 TIL - 콘솔 텍스트 알피지 만들기 2 (0) 2023.08.22 내일배움캠프 14일차 TIL - 콘솔 텍스트 알피지 만들기 (0) 2023.08.21 내일배움캠프 12일차 TIL - Console.SetCursorPosition으로 UI 찍어내기 (0) 2023.08.19 내일배움캠프 11일차 TIL - System.Media.SoundPlayer 클래스로 사운드 재생하기 (0) 2023.08.18 내일배움캠프 0일차 TIL - 깃이랑 친해지자 (0) 2023.08.07