eo icon indicating copy to clipboard operation
eo copied to clipboard

Home.java:44-46: create load function (it has to be able...

Open 0pdd opened this issue 1 year ago • 3 comments

The puzzle 1105-4c34ccb4 from #1105 has to be resolved:

https://github.com/objectionary/eo/blob/f037ce68a9f1d9e7f46ea638739c134400809555/eo-maven-plugin/src/main/java/org/eolang/maven/Home.java#L44-L46

The puzzle was created by @rultor on 20-Sep-22.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

0pdd avatar Sep 20 '22 08:09 0pdd

@mximp please, take care of this one

yegor256 avatar Sep 20 '22 09:09 yegor256

@yegor256 Do we really need load function? I suggest implementing this by replacing all path with new Home().path(path). It allows us to get all files by corrected path. What do you think about this idea?

yasamprom avatar Sep 23 '22 13:09 yasamprom

@yasamprom it seems logical to me to have Home class like this:

class Home {
  load();
  save();
  exists();
}

yegor256 avatar Sep 23 '22 15:09 yegor256

@yegor256 I still have some questions. For example, we have this code in PlaceMojo.java:

final Path home = this.targetDir.toPath().resolve(ResolveMojo.DIR);
if (new Home().exists(home)) {
    final Collection<String> deps = new DepDirs(home);

I guess we will have to replace DepDirs(home) with DepDirs(new Home().path(home)). Am I right? If yes, we will also have to do the same in many other places. Then I don't understand why having load function is better than usage of path(path) everywhere we use simple path. If we do that, we will use new Home().path(path) almost always except places where we use load. Is it good?

yasamprom avatar Sep 26 '22 09:09 yasamprom

@yegor256 what do you think?

yasamprom avatar Oct 06 '22 10:10 yasamprom

@yegor256

yasamprom avatar Oct 17 '22 08:10 yasamprom

@volodya-lombrozo please assist

mximp avatar Oct 18 '22 14:10 mximp

The puzzle 1105-4c34ccb4 has disappeared from the source code, that's why I closed this issue.

0pdd avatar Oct 20 '22 09:10 0pdd