Hi Christoffer,
Thanks for your input!
On Thu, 2018-03-29 at 12:14 +0200, Christoffer Holmstedt wrote:
It has been a year or two since I touched the Inkscape codebase but
have recently been introduced to the idea of a "Screaming
architecture by Robert C. Martin/Uncle Bob" [1, 2] in other
development efforts and started to practice it. It might not be
doable right now for Inkscape but goes along the idea that we want
WITH_UI flag in the build system (be able to build headless inkscape
that is). Also it should make it easier for new developers to
understand the codebase just by looking at the file/directory
structure.
Interesting ideas, which I mostly agree with. The problem, I think, is
that truly descriptive names are going to be too long.
### Inside "src" folder
There is nothing in the directory structure that clearly shows that
this is an awesome SVG application.
1. What is the difference between "display" and "ui"?
display is for drawing the SVG and controls on the canvas. Perhaps is
should be renamed to 'render' or 'canvas'.
2. Is "ui" a gui or also command line?
Both.
3. "Manipulation", it is impossible to understand what it
is being
manipulated with just a one-layer folder structure.
True. Each folder will have a README to explain what is in the folder.
I can't think of a better name.
4. "Object", it is impossible to understand what an
"object" is in
this application without reading the code.
This is the name we've always used. I can't think of a better one. It's
explained in the README.
5. "extensions", what is the difference between a
functionality
implemented as an extension and right away in the core of the
application? In my opinion the word "extension" is to vague.
I agree with this. Will bring it up for discussion today.
6. "libraries" folder,
3rd party libraries included as source code, this is good idea but
shouldn't 3rd party lib folder be next to "src" not inside it?
I'll bring this up for discussion.
I did a quick example on the Inkscape wiki [3]. This is just an idea
and I'm not sure how feasible it is for Inkscape as I don't
understand the codebase that good. The main idea is that business
logic, that is SVG functionality goes into "core". The core parts
knows nothing about the entrypoints (gui, command line, http API) nor
data providers (file system, in-memory data storage).
[1]
https://8thlight.com/blog/uncle-bob/2011/09/30/Screaming-Architec
ture.html
[2]
https://www.slideshare.net/mattiabattiston/real-life-clean-archit
ecture-61242830 - One example on how "screaming architecture" could
be implemented.
[3]
http://wiki.inkscape.org/wiki/index.php/Source_Directory_Structur
e_Screaming_Architecture