xmolecules/jmolecules

Somewhat lacking documentation

kLeZ opened this issue · 0 comments

kLeZ commented

Hi, I'm using jMolecules for some months now, and I found really hard to write working code that can work with the tooling and frameworks it's documented to collaborate with.

Mainly, I'm using the polymorphic approach to the models, I wonder if this is not the recommended behavior anymore and I should instead use the annotation style of programming.

I refer to a specific use case, lacking sufficient "getting started" documentation in my opinion.

I'm building an application based on Spring Boot, with Spring Cloud, Spring Modulith and the common other libraries of the ecosystem, something that is documented to work well with the jMolecules bytecode magic.

But I had some really hard times putting it all together without the need for extensive searching in the internet. And I was really only be able to find some few poorly documented personal experimentation projects here on GitHub, to start over from.

The principal difficult thing to spank to make it run is fighting again and again with the model and the bytecode manipulation done by the jMolecules-DDD and jMolecules-Spring packages. Interestingly, I cannot come up with a way to have an AggregateRoot with a record Identifier generate a Long sequence on the JPA/Hibernate part, receiving a "Null id generated for entity" exception by the JPA layer.

The only thing I was able to do, without over complicating my entity code with specific implementation details (keep a sequence in memory and generate it myself in the default constructor) was to transform all my identifiers to UUIDs. In this way I can just implement a default constructor with this.id = new SomeIdentifier(UUID.randomUUID());, but it's clearly less than optimal for a simple aggregate implementation on the database side.

Moreover I found it really hard to add features and behaviors that I'm already used to add (without the jMolecules thing) to more or less all my services, that's mainly the Spring Data REST and some specific Spring Cloud features, but I had some headaches mouting implementation details such as Jackson serialization done sufficiently well (I'm encountering little quirks here and there to be solved by somewhat unneeded configurations in "standard" Spring Boot services).

I'm asking if working with the stack I mentioned, that's Hibernate -> Spring Data JPA -> Spring Data REST -> Spring-HATEOAS and Jackson in the middle of the stack is the recommended, or even a good way of doing things in the jMolecules world. I'm coming up with this question because the implementation for me was not as straightforward as I thought it should be for a framework that's considered stable somewhat and that's told to be working well with the Spring ecosystem.

Am I doing something wrong? All that I've explained here as components and behaviors I put together in my application was the work of searching the net and hacking around, with a global lack of documentation and uncertainty of how to do things in the jMolecules way, apart from the really really basic examples provided that are to me more of a showcase instead of a real getting started.

Do you have plans to improve documentation and make things work more straightforward?

Can I help with something? Even if I'm really only at the beginning of the journey with jMolecules and I'm not really able to write Getting Started or some other deeply specific piece of documentation yet.