• 0 Posts
  • 2 Comments
Joined 2 个月前
cake
Cake day: 2024年12月4日

help-circle
  • Usually my models only store data, meaning the files that contain them don’t have much code. The decision also depends on the tools you are using and who you are working with. I would fallback to the rule of separation of responsabilities and write a new class for the purpuse of serializing the model (which could and should also serialize similiar models). This way is universal in any language and can easily be understood by future you and colleages.