On 2010-12-09 12.28, Niclas Hedhman wrote:
FTR, While having an AssemblyException in my domain code, Apache Karaf
(my OSGi container of choice) and my Qi4j started, was trying to
create the Qi4j app every 15 secs or something, over night. When I
came in the morning, 1.2 million classes had been loaded and unloaded,
with a delta of 4000 (kind of expected). And memory had not grown over
the top; From a minimum of ~12MB to ~22MB. Let's say there was 7000
(only every 30sec) Qi4j starts per hour, times 15 hours, gives us
~100,000 tried starts. That would be 100 bytes leak per start, and I
doubt a ASM generated class would fit in that, assuming only a single
Mixin subclass was created.

Well that's pretty cool! As I said, the problem we had was with FileInstall having funky ideas of what to do when the bundles changed, so that is a very specific issue. But one that should have been fixed, like, aaaages ago. That was the sad part. OSGi as such I have no problem with (not anything serious anyway).

Hmmm... This at first glance increases the complexity level. I also
have a mental issues with "events" being converted to "commands",
since I have this notion that "commands may fail".

Only if you make the commands such that there are failure conditions. It is perfectly ok to make commands that can never fail, if you were able to construct them properly. The idea is that an event tells you what happened in another system, and if you want to react on it by creating a command on your domain model, which in turn creates a new event, that is fine.

It then also become loosely coupled between the entities, since they don't have to know about each other. It is the service that knows "take this, send that". This becomes especially important in the distributed case. If the domain entity needs to subscribe directly, then all events must be sent everywhere. With the service, it can be close to the source, then route the non-failable-command to the entity which can be anywhere on the network. It's a bit of putting logic (the routing logic in this case) as close to the data source as possible.

Just need to port the EventSourcing API/SPI/impl to Qi4j. Hopefully this
weekend.

Perhaps you should code dump it first. Just don't modify the
lib/pom.xml to include the module in the build. OR, try out 'create a
new remote branch with it'... :-)

That would work.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to