Refactoring Primitive Obsession #689
Replies: 2 comments 2 replies
-
|
Hey Greg! I'm dealing with a similar issue right now. Did you figure out a composite recipe that would work for you? Still trying to figure out a recipe to detect methods of a given primitive. I also was considering using |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Closing as stale; feel free to open a new discussion if this is still relevant. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to get started writing Recipes and struggling.
What I would like to do is detect a primitive collection such as
List<Product>and turn it into a
ProductListthat encapsulates the list via composition.For that I see the following steps necessary:
List<Product>that were actually used such asadd, andremove.ProductListthat holdsList<Product>as a field and delegates methods that were previously used.List<Product>toProductListFor 3. I could use the preexisting
ChangeTyperecipe, however, then I needed to make a composite of many Recipes. This is already my first Question. Can I make a composite of many Recipes and test it as well as use it as if it was just a single one?update: just noticed that recipes implement a chain of responsibility.
How would you go about solving this problem overall?
How could I find all used methods of List to use them in a new JavaTemplate that created the WrapperClass? Ideas welcome.
greetings,
Gregor
Beta Was this translation helpful? Give feedback.
All reactions