Hello guys,

@Niclas
Thank you for your advice. Not sure what you mean with "cut" away - I
just took the
assembly from the dci-cargo.dcisample_b as I;m using it as a kind of
"template". The
Assembly structure is also taken from that sample project. I do not have
yet a Qi4j based application but I try to setup one  as a kind of blueprint
and as a comparison basis with the classic approaches using
spring/jboss//hibernate.
I;m personally already convinced by the tons of excellent ideas within Qi4j.
Its quite unique. So trying to convince others :-)

I also agree with your proposal of the assembly structure with some small/open
questions like should be the Context Objects also composites ? There
are a number
of benefits to do so (injections of structures/uof), but also there
are some disadvange like e.g.
performance issues. As I understood from the performance test the
overhead using
composites versus "naked" objects is about 50:1. But sure, if I can
benefit from clear
structures in the code, clear object ownership etc. I;m ready to add
additional boxed
to compensate the performance "penalties" using composites everywhere
(if there are
really performance issues, what is not clear yet).

I;m also thinking on a kind of vertical layering as we have more
Application here like :

Accounting
Billing
ProductManagement

And I would like to "assembly" them togerher  (in terms of a Qi4j
Application) during development
but later in production they would be seperated - each in his own
node, therefore separed  (J)VMs
and "synchronized" using the even-sourcing pattern.

@Paul
Thank you for offering the sql-sample support. Works for me !

Cheers,
Jiri

2012/10/27 Niclas Hedhman <[email protected]>:
> I see that you have tried to "gut" away your actual app and renamed
> the bits that you think creates a problem.
>
> I also see a worrying pattern; You are storing all kinds of Qi4j
> artifacts in the AbcApplication singleton. This is NOT allowed. Qi4j
> insists on owning all those objects. Perhaps you think there is only
> one QueryBuilderFactory? No. In fact, all those factories are now gone
> in favor of Module, since it is in fact one of those per Module.
>
> If I was on your team, I would disagree with the layering chosen as well.
>
> Typically;
>   1. Interface layer (WS-*, ReST, RMI, ++)
>   2. Application layer (coordination/orchestration)
>   3. Domain layer (business logic)
>   4. Infrastructure
>
> However, there are many reasons to deviate from that recommendation,
> but it is a reasonable starting point.
>
> Since you have taken away all the content in the layers, I can't
> advice what belongs where and defeats the purpose...
>
> So, if you instead follow the layering above, for ANY setup of
> EntityStore and Indexing;
>
> * Add the ConfigurationComposites of Indexing and the primary
> EntityStore into a Module called "Configuration", which has another
> EntityStore inside it (for instance the MemoryEntityStore) which
> doesn't require configuration, and the ConfigurationComposites set to
> Visibility.layer, BUT the Configuration module's ES is
> Visibility.module.
>
> * The EntityStore and Indexing you choose is likely to have an
> Assembler defined. The documentation for the SQL ES is reasonable;
>        http://www.qi4j.org/extension-es-sql.html
>    but I think the SQL Indexing one is far from clear.
> (Paul/Stanislav; can you make the context of the code sample a bit
> more explicit)
>        http://www.qi4j.org/extension-indexing-sql.html
>    You don't have to use the Assemblers provided, but they are
> intended to make your bootstrap code simpler.
>
>
>
> Cheers
> Niclas
>
> On Sat, Oct 27, 2012 at 9:32 PM, Jiri Jetmar <[email protected]> wrote:
>> Hi Niclas,
>>
>> https://dl.dropbox.com/u/11404177/com.smartnerds.qi4j.test.persistence.zip
>>
>> Thank you.
>>
>> Cheers,
>> Jiri
>>
>> 2012/10/27 Niclas Hedhman <[email protected]>:
>>> Can you upload your whole thing somewhere, so I can take a look at how
>>> you have managed to get it wrong and where we can improve docs to
>>> avoid this in the future...?
>>>
>>>
>>>
>>> On Sat, Oct 27, 2012 at 5:24 PM, Jiri Jetmar <[email protected]> 
>>> wrote:
>>>> Hello guys,
>>>>
>>>> I tried to follow your advices and also added the Queryable(false) flag
>>>> to org.qi4j.library.sql.common.SQLConfiguration.
>>>>
>>>> I adapted my assembly from the cargo_dcisample_b source code as I;m
>>>> using this sample
>>>> as a kind of "inspiration" for my own project.
>>>>
>>>> Attached there is a simple project where I was trying to solve the SQL
>>>> Entity/Indexing
>>>> issue. To keep it very simple I used the
>>>>
>>>> SQLTestHelper.assembleWithSQLEntityStore(indexingModule);
>>>>
>>>> statement found in the JUnit tests. Also played with the visibility flag
>>>> in SQLTestHelper.doCommonAssembling() but either I received the
>>>>
>>>> 1.) org.qi4j.api.service.NoSuchServiceException: Could not find any
>>>> visible ServiceComposite of type [org.qi4j.spi.query.EntityFinder]
>>>> or
>>>> 2.) java.lang.IllegalStateException: java.lang.StackOverflowError
>>>>
>>>> Sorry guys, I was not able to solve it by my self... :-(
>>>>
>>>> Cheers,
>>>> Jiri
>>>>
>>>>
>>>> 2012/10/27 Stanislav Muhametsin <[email protected]>:
>>>>> Quoting Niclas Hedhman <[email protected]>:
>>>>>
>>>>>> Ok, Paul's description seem right.
>>>>>>
>>>>>> On Sat, Oct 27, 2012 at 1:28 AM, Paul Merlin <[email protected]> wrote:
>>>>>>
>>>>>>> Third, the endless loop seems to come from the DataSourceConfiguration
>>>>>>> loading and to take place in EntityStore.newUnitOfWork(..) but at first
>>>>>>> sight and without a complete test case I can't see why it goes crazy 
>>>>>>> like
>>>>>>> that.
>>>>>>
>>>>>>
>>>>>> Well, my guess is that the Configuration for Indexing is Queryable.
>>>>>>
>>>>>>   - initialize indexing
>>>>>>   - initialize config
>>>>>>   - send config for storage
>>>>>>   - config is queryable
>>>>>>   - notify indexing
>>>>>>   - initialize indexing
>>>>>>   - ....
>>>>>>
>>>>>
>>>>> The configuration for SQL Indexing is same as for SQL EntityStore,
>>>>> org.qi4j.library.sql.common.SQLConfiguration. I've pushed change to add
>>>>> Queryable(false) attribute the the property of that configuration, tell me
>>>>> if that helps.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> qi4j-dev mailing list
>>>>> [email protected]
>>>>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>>>
>>>> _______________________________________________
>>>> qi4j-dev mailing list
>>>> [email protected]
>>>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>>>
>>>
>>>
>>>
>>> --
>>> Niclas Hedhman, Software Developer
>>> 河南南路555弄15号1901室。
>>> http://www.qi4j.org - New Energy for Java
>>>
>>> I live here; http://tinyurl.com/3xugrbk
>>> I work here; http://tinyurl.com/6a2pl4j
>>> I relax here; http://tinyurl.com/2cgsug
>>>
>>> _______________________________________________
>>> qi4j-dev mailing list
>>> [email protected]
>>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>>
>> _______________________________________________
>> qi4j-dev mailing list
>> [email protected]
>> http://lists.ops4j.org/mailman/listinfo/qi4j-dev
>
>
>
> --
> Niclas Hedhman, Software Developer
> 河南南路555弄15号1901室。
> http://www.qi4j.org - New Energy for Java
>
> I live here; http://tinyurl.com/3xugrbk
> I work here; http://tinyurl.com/6a2pl4j
> I relax here; http://tinyurl.com/2cgsug
>
> _______________________________________________
> qi4j-dev mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/qi4j-dev

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

Reply via email to