Is it sensible to have micro-modules, say with only a very few (perhaps one) class in it? Or should I store things in bigger repositories?
I am long-time Java developer with a software-engineering background. I try and write well encapsulated, focussed OO code. I have previously written code in large modules/projects/repositories with main module depending upon "common" modules.
"Common" modules seem to be a code-smell in the same way as common/util classes - a sign that someone hasn't thought what the real, clean encapsulation is.
I am now wanting to publish some articles on a blog and back them up with code on BitBucket, with 1 article with its own module & repository.
I like clean dependencies, hate duplication, etc and there are natural downward dependencies from 1 module to "common" code.
Java doesn't make dependency management very easy (hopefully fixed in Java 9 with Jigsaw), but interestingly Google Dart has a very nice mechanism and seems to recommend small, tight modules (and presumably repository per module).
I'm thinking of small modules of Java, with Maven dependencies. Each module in its own repository. Jar's published on some maven site.
EDIT: 1) I want to write some blog posts. Each post will be about a different topic. Each topic will relate to a cohesive module of code. I want readers to be able to download the module of code for the post.
2) I am using Bitbucket as my git repository. Point 1) implies (?) that I need a repository per module/blog article.
3) I'm trying to do things reasonably correctly: don't need perfection
4) Blog articles are only part of it: I want a good decomposition into modules for sound software engineering reasons.
5) I'm not ready to make my repositories public yet, they are incomplete, but these are the modules I currently plan: - 5a) Validation - just a single class with useful validation (I like DbC-like stuff!) 5b) HTML generator - nice module to generate HTML from Java - depends on Validation 5c) Swing "panning" component - again depends on Validation
6) Each of the modules in 5) depend upon Validation and are also discrete modules.
So, should I have 6a) 3 x repositories (allowing people to easily pick and mix) 6b) 1 x repository building a single jar 6c) 1 x repository building 3 x jar, 1 per "module"