Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunMojo.java:43-45: Let's avoid code duplication between... #42

Closed
dmarkov opened this issue Dec 24, 2015 · 21 comments
Closed

RunMojo.java:43-45: Let's avoid code duplication between... #42

dmarkov opened this issue Dec 24, 2015 · 21 comments
Assignees

Comments

@dmarkov
Copy link

dmarkov commented Dec 24, 2015

Puzzle 41-e81ff08d in src/main/java/com/jcabi/dynamodb/maven/plugin/RunMojo.java:43-45 has to be resolved: Let's avoid code duplication between this class and StartMojo. One idea is to create a decorator called ThreadedMojo that receives another mojo in its constructor and, when called, runs it inside a thread.... The puzzle was created by Denis N. Antonioli on 17-Dec-2015.

If you have any technical questions, don't ask me, submit new tickets instead


- `42-3038f9e6`/#46 (by )
@dmarkov
Copy link
Author

dmarkov commented Jan 7, 2016

@jrdalpra please proceed, it's yours

@dmarkov
Copy link
Author

dmarkov commented Jan 7, 2016

@yegor256 there is a puzzle in this code 42-3038f9e6/#46, we'll resolve it later

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@dmarkov I don't really think that this is a good issue. There's no code duplication here. https://github.com/jcabi/jcabi-dynamodb-maven-plugin/blob/master/src/main/java/com/jcabi/dynamodb/maven/plugin/Instances.java already encapsulates all the work.

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@pinaf @denisa can you explain this issue to me? Thanks.

@pinaf
Copy link

pinaf commented Jan 7, 2016

@jrdalpra the difference between RunMojo and StartMojo seems to be just the threading.

@denisa
Copy link

denisa commented Jan 7, 2016

StartMojo launches dynamodb on a thread; the thread is killed once the jvm ends.
So, calling mvn dynamodb:start will launch dynamodb, then end the jvm and kill dynmodb

RunMojo launches dynamodb on the main thread.
So, calling mvn dynamodb:run will launch dynamodb and never return.

On Jan 7, 2016, at 08:55, José V. Dal Prá Junior [email protected] wrote:

@denisa https://github.com/denisa can you explain this issue to me? Thanks.


Reply to this email directly or view it on GitHub #42 (comment).

Two ways to build software:
(1) make it so simple that there are obviously no bugs,
(2) make it so complicated that there are no obvious bugs.
-- C.A.R. Hoare (1980 Turing Award Lecture)

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@pinaf @denisa I don't see any difference at both implementation. Both users start method at Instance class. Only differences are the name and the maven build phase. What's the point?

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@pinaf I'm not seeing this difference at souce code. Can you show me line? Thanks.

@pinaf
Copy link

pinaf commented Jan 7, 2016

@jrdalpra here's what happened: #43

@pinaf
Copy link

pinaf commented Jan 7, 2016

@yegor256 looks like this issue is invalid as @simonjenga fixed it in another PR (#43)

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@yegor256 @dmarkov @pinaf :) That's true. We are trying to solve something that's already solved. :)

@jrdalpra
Copy link
Member

jrdalpra commented Jan 7, 2016

@dmarkov can you close the issue? thanks.

@dmarkov
Copy link
Author

dmarkov commented Jan 8, 2016

@yegor256 Closing, thanks all

@dmarkov dmarkov closed this as completed Jan 8, 2016
@dmarkov
Copy link
Author

dmarkov commented Jan 8, 2016

@jrdalpra Much obliged! I have added 1 hour to your account in payment "AP-3MN93852HE477612F", 49 mins spent... m=49, that's why a bonus here for fast delivery... added +60 to your rating, now it is equal to +218

@dmarkov
Copy link
Author

dmarkov commented Jan 11, 2016

@dmarkov can you close the issue? thanks.

@jrdalpra closed

@jrdalpra
Copy link
Member

@dmarkov thanks :)

@dmarkov
Copy link
Author

dmarkov commented Jan 11, 2016

@dmarkov thanks :)

@jrdalpra no problem :)

@dmarkov
Copy link
Author

dmarkov commented Mar 7, 2016

@yegor256 last puzzled solved 42-3038f9e6/#46

0pdd referenced this issue Nov 16, 2017
Update URL for Javadoc badge's image
@0pdd
Copy link

0pdd commented Feb 23, 2018

@dmarkov all puzzles are solved

1 similar comment
@0pdd
Copy link

0pdd commented Feb 23, 2018

@dmarkov all puzzles are solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants