Gradle version

15 views
Skip to first unread message

Christian P. Lerch

unread,
Nov 9, 2014, 7:02:14 AM11/9/14
to qi4j...@googlegroups.com
I'm trying to build the samples with already installed Gradle version 2.0, but it doesn't work: there are some DSL errors.
E.g. mavenrepo url: '...'  is not recognized, instead Gradle wants the maven { url '...' } notation.
What version of Gradle do you recommend?

Jiri Jetmar

unread,
Nov 9, 2014, 7:08:24 AM11/9/14
to Christian P. Lerch, qi4j...@googlegroups.com
Hi Christian, 

thanks for posting. What command (gradle --daemon xxx) are you executing ? In general - what about to use the included gradle wrapper ? What is your use-case ?

Cheers, 
Jiri 

--
You received this message because you are subscribed to the Google Groups "qi4j-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qi4j-dev+u...@googlegroups.com.
To post to this group, send email to qi4j...@googlegroups.com.
Visit this group at http://groups.google.com/group/qi4j-dev.
For more options, visit https://groups.google.com/d/optout.

Niclas Hedhman

unread,
Nov 10, 2014, 12:47:57 AM11/10/14
to Christian P. Lerch, qi4j...@googlegroups.com
Christian,

Yes, the samples have not been upgraded to work with Gradle 2.x.

Suggestion; 
   git clone g...@github.com:Qi4j/qi4j-sdk.git
   cd qi4j-sdk
   ./gradlew assemble install

and in that process the samples will be built/tested as well.

./gradlew is the "Gradle wrapper" that Jiri mentions.


Cheers
Niclas

--
You received this message because you are subscribed to the Google Groups "qi4j-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qi4j-dev+u...@googlegroups.com.
To post to this group, send email to qi4j...@googlegroups.com.
Visit this group at http://groups.google.com/group/qi4j-dev.
For more options, visit https://groups.google.com/d/optout.



--
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

Jiri Jetmar

unread,
Nov 10, 2014, 3:11:36 AM11/10/14
to Niclas Hedhman, Christian P. Lerch, qi4j...@googlegroups.com
Hi Christian, 

I;m also using the 

./gradlew idea

to generate the corresponding .ipr and .iml files and simply open them in Intellij. 

"In essence I'm trying to get familiar with qi4j (which isn't easy, because its far off mainstream application architecture, but nevertheless looks very promising to me)."

Yes, Qi4j is pretty cool. But for some unknown reasons it seems that not everybody is convinced. Let me know when you need some help. Most likely I;m able to 
help/explain. If not, we have still the gurus here - Niclas & Paul.. :)

Cheers, 
Jiri

Niclas Hedhman

unread,
Nov 10, 2014, 5:55:42 AM11/10/14
to Jiri Jetmar, Christian P. Lerch, qi4j...@googlegroups.com

One aspect that is implicit in Qi4j, and perhaps not stressed enough is;

   * Qi4j runtime "owns" the creation of Composites (and optionally other Objects) and can therefor;
       a. ensure "visibility" and hence enforce application architecture (i.e. layers and modules)
       b.  "own" the Method Invocation "into" and "within" the Composites.
       c. remove a lot of boiler plate code, and allow custom implementations (e.g. PropertyMixin can easily be overridden)
       d. re-purpose interfaces for multiple uses, e.g. the built-in query language use


IOW, the reason that Qi4j is so "far off mainstream" is because not only do we question everything that everyone has been doing wrong all the time (incl ourselves), but also have the means to do something about it, make us create better software, and faster by simply allowing us to focus on the inherent complexity in the domain, rather than the accidental complexity that is introduced by brain dead technologies, such as JPA, Spring and many more.

There are still a lot of things to do in Qi4j, which we haven't yet been fully addressed, such as;
   - Events in general, not only the effort in Event Sourcing.
   - Timeseries data, and non-corrupting data storage (i.e. no Updates and Deletes) 
   - A stronger REST API approach. The current libraries are probably more flexible than I would like, and too hard to get to do the basic things.
   - JDK8 streaming API, closures and much more. Work in-progress.


Don't hesitate asking any question...

Niclas

Niclas Hedhman

unread,
Nov 10, 2014, 6:04:17 PM11/10/14
to Christian P. Lerch, qi4j...@googlegroups.com
[back on list, for others to consume]


Qi4j needs a relatively(!) simple bootstrap process, that is easily embeddable in other frameworks. 

    @Override
    public void init( ServletConfig config )
        throws ServletException
    {
            qi4j = new Energy4Java();
            ApplicationAssembler assembler = createApplicationAssembler( config );
           application = qi4j.newApplication( assembler );
           application.activate();

where createApplicationAssembler() sets up the application structure, and declares all the composites to be used, in which modules, and how the layers are related. The 'dirty' solution is to put everything in a single module in a single layer (not recommended for production software), then one can use the SingletonAssembler;

        assembler = new SingletonAssembler()
        {
            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
                module.entities( MyEntity1.class, MyEntity2.class, ... );
            }
        };

(it is also possible to override beforeActivation())

Qi4j also supports a concept called ImportedServices, which means that the lifecycle of the Service is residing outside the Qi4j runtime, but it can be injected to be used as a regular Qi4j service. The requirement is that the service instance is injected during bootstrap.

Regarding performance;
Yes, Qi4j does a lot in the invocation of methods on composites, and it will not look particularly good on benchmarks. However, in real applications, we claim that this overhead is small, possibly negligible, as most applications today are bogged down by 'heavy' calculations such as serialization of objects to Strings and byte[], e.g. JSON and XML. 
And it is likely to perform "better" than a Hibernate application, as JPA+SQL is slower than any of the many NoSQL entity stores that are pluggable into Qi4j (at bootstrap time, application doesn't need to change). Even Qi4j's SQL entity store is a matter of key-value lookup, and likely to outperform Hibernate (at least before people start hand optimising every Hibernate access, i.e. have to waste development time on accidental complexity).

We would love to look at benchmarkable REAL applications, but we haven't seen any reasonable benchmarks for it. If you know any, let me know. Since persistence is a big chunk of it, perhaps http://www.jpab.org/ could be adapted, although it will be very different.


Cheers
Niclas

On Mon, Nov 10, 2014 at 10:50 PM, Christian P. Lerch <christia...@gmail.com> wrote:
Thanks for your insights.

My major concerns in this early phase of getting familiar with qi4j are more about general characteristics of your framework like openess, interoperabilit, non-intrusiveness, performance and the like.

For instance packaging: 
I understand that I can package a qi4j application as a jar and as a war, but can I also package it as an OSGi bundle and deploy it to e.g. Apache Felix?

Or interoperability with external (web) frameworks:
Can I easily put an qi4j application (packaged as a jar) on the classpath of another app or framework and just call its service layer from outside?

I'm currently collecting question of this kind, and will post them on qi4j-dev, after cross-checking with your faqs.

Best regards,
Chris
Reply all
Reply to author
Forward
0 new messages