Skip to content

Single generic data object vs separate data object for each request/response #129

Discussion options

You must be logged in to vote

I think it depends on the complexity of the data and you can use both approaches in project. For example, in the project for which we created this package, we almost always use approach one in the beginning. As soon as everything starts getting complicated for a specific case, then we split up these data objects into Create, Update and base data objects.

I think we split up 10 objects in total upon a 200+ data objects project so that's in my opinion the best approach. Keep everything as simple as possible but don't be afraid to split up data objects when it makes your code more readable and more simple.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by freekmurze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants