Step 2 is optional because sometimes a use case is a plain CRUD action that only needs to update the database. Other times I need the full blown object-oriented dance of the entities in order to get the result that is either presented directly in a view or saved to the database.
My question is, how should I clean up step 2? Some of the methods that instantiate entities are very long and I feel they need their own separate class. What would that class be called? I'm using Serializers for presenting data from Repositories to the views. I need something like a reverse serializer or de-marshaller.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discu...@googlegroups.com.
To post to this group, send email to clean-code...@googlegroups.com.
Visit this group at http://groups.google.com/group/clean-code-discussion.
You can use the Builder Pattern, and have a method in the Builder that builds an entity from a data structure. :)Hope this helps,Caio
On 19 Dec 2013, at 12:55, Reed Law <ree...@gmail.com> wrote:
My Interactors typically have 2 or 3 steps:
- Load up data from a Repository needed by this particular use case
- Instantiate entities that interact with the data and produce a set of results (optional)
- Save new data to the Repository
Step 2 is optional because sometimes a use case is a plain CRUD action that only needs to update the database. Other times I need the full blown object-oriented dance of the entities in order to get the result that is either presented directly in a view or saved to the database.
My question is, how should I clean up step 2? Some of the methods that instantiate entities are very long and I feel they need their own separate class. What would that class be called? I'm using Serializers for presenting data from Repositories to the views. I need something like a reverse serializer or de-marshaller.
--
The only way to go fast is to go well.
---
You received this message because you are subscribed to the Google Groups "Clean Code Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clean-code-discussion+unsub...@googlegroups.com.