jpeek icon indicating copy to clipboard operation
jpeek copied to clipboard

Java architecture is really procedural

Open amihaiemil opened this issue 8 years ago • 4 comments

Classes like Reports and App are filled with if statements and maps of parameters called params.

I saw the effects of this in 3 PRs so far: https://github.com/yegor256/jpeek/pull/168, https://github.com/yegor256/jpeek/pull/173 and https://github.com/yegor256/jpeek/pull/179

All 3 of them introduced rather ugly code, but it's not their fault, that's where the architecture drives to. I think we should start refactoring.

We can start with a PomXml object which would animate the base's pom.xml file and provide any info related to it.

amihaiemil avatar Feb 14 '18 18:02 amihaiemil

@yegor256/z please, pay attention to this issue

0crat avatar Feb 14 '18 18:02 0crat

I think I'm OK with just naming it Pom:

public final class Pom implements XML {
   //implement XML methods
   //add new methods specific to pom.xml
}

llorllale avatar Feb 15 '18 20:02 llorllale

@llorllale Not really, if it implements XML then it will offer just the "low level" operations of interface XML and you would still have to write code in order to get what you want from that XML.

I would like it to be more high level and have methods such as version(), scmUrl(), developers(), dependencies() etc

And if you want to have access to the underlying XML, then it could simply have method xml() which would return the raw thing.

amihaiemil avatar Feb 16 '18 11:02 amihaiemil

@amihaiemil agreed

Although I prefer the name Pom instead of PomXml.

llorllale avatar Feb 17 '18 14:02 llorllale