aikin / thinking-listening-reading

记录那些听过和读过的文字。
1 stars 0 forks source link

Thinking Twice Before Reuse The Models Across Different Layers Inside Microservice #193

Open aikin opened 2 years ago

aikin commented 2 years ago

When doing layered architecture, I wonder if the different layers have different models, so the models have their own responsibilities.

Sometimes, we maybe want to reuse the models across different layers. According to the SOLID principles, I wonder if it might cause some issues.

For my understanding, It's desirable for having different models for different layers, because it provides isolation. Decouple models, and make them independency, it provides maintainability.

Refs