Skip to content

concept check on features, jobs and operations #19

Answered by Mulkave
bdelamatre asked this question in Q&A
Discussion options

You must be logged in to vote

@bdelamatre this is such an interesting case you ran into. I could think of an approache that i wish can help inspire you to come up with a solution to write the code once and reuse the parts that are needed. But before that, I would like to highlight that Lucid isn't here to incur constraints, you can do what you want with your code but the guidelines are there to help you keep it concise. All possibilities of PHP itself still exist so you may do whatever you like with the units you are writing.

Use inheritance (OOP)

Create a parent (abstract) feature SubmitOrderFeature from which the rest of the features descend. In its handle method you run UpsertOrderJob and UpsertOrderServicesOperation

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Mulkave
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