Edited
・
Reviews 3
・
Average rating 5.0
Thank you for taking the time to respond even to simple course reviews. After taking the class and thinking about separation of concerns, I had some questions, so I ended up modifying my course review. ^^; Objects are meant to handle the business logic concerns of the domain, but at this point, I don't think objects need to take on logging concerns. Should all objects receive logger objects through injection? Then would logger need to go into every object's constructor... I'm curious if there's another elegant way to handle this. Also, I think contextual information is needed when logging... Should objects internally receive contextual information as well... then would this also need to be injected? It's difficult. I would appreciate your guidance. Have a happy day today as well.
Thank you for leaving a review, Namcheol Jo. Congratulations on completing the course, and please feel free to leave questions if you have any curious points later on. The weather has gotten much colder, so please take good care of your health and have a happy weekend. Thank you.
Hello, Mr. Jo Nam-chul. I just saw your edited review now since we don't receive notifications for review modifications. Next time, if you leave your question in the community Q&A section instead of the reviews, I'll be able to respond more quickly. 😊 To answer your question directly: you should not add logging logic and dependencies to domain objects. Adding a logger degrades design quality in both cohesion and coupling because it introduces responsibilities and dependencies unrelated to domain logic. Logging should be done in the Service layer of the application layer using the execution results of domain objects. Even if you need logging at the domain object level, instead of directly depending on a logger, it's better to use techniques like AOP to solve this without adding dependencies to the domain objects. I hope this answers your question. 😊 If you have any other questions, please leave them in Community > Q&A, and I'll respond quickly. It's snowing heavily, so please get home safely. Thank you!




