InfoQ

News

Qi4j introduces Composite Oriented Programming

Posted by Rob Thornton on Nov 16, 2007

Community
Java
Topics
Announcements ,
Object Oriented Design ,
Artifacts & Tools
Tags
Qi4j
"Classes are dead, long live interfaces" was declared by Rickard Oberg at Oredev this week where he announced Qi4j. Qi4j brings the new idea of Composite Oriented Programing, in which is no behaviour at all is put in a class, instead the class becomes a 'composite' of mixins and interfaces declared on the class via annotations.

Qi4j itself is a Java framework built to make Composite Oriented Programming available to all Java developers. While Composite Oriented Programming will require a large mind-shift, it does not require separate tools, language, or XML. Qi4j applications will be able to run inside a Spring application, a web application container, OSGi, and elsewhere. Qi4j makes heavy use of annotations to push the knowledge of framework specifics away and bring developers closer to the business rules. Rickard Öberg and Niclas Hedhman, the founders of the project, describe it in a press release as:

"Qi4j is a framework for domain centric application development, including evolved concepts from Aspect Oriented Programming, Dependency Injection and Domain-Driven Design, leveraging the Java 5 platform and eco-system", says Niclas Hedhman a long-term Java framework developer and now active Apache member.

"I need a system that puts the domain model and business rules back in focus, allowing clear communication between domain experts and developers.", says Rickard Öberg, the former JBoss, Webwork and XDoclet founder.

As this is only the initial revealing of the framework and paradigm, documentation and examples are still sparse. However, the goal of Composite Oriented Programming is to switch from thinking about objects to thinking about composites. Composites are composed of re-useable fragments. Fragments are the building blocks of Qi4j. They carry the state of composites (in mixins), validate and constrain the usage of them (in constraints), handle cross-cutting concerns (in concerns) and provide notifications, cache and undo management, and other asynchronous needs (in side effects). The switch of programming paradigms is not an easy one. Oberg describes the reactions to Composite Oriented Programming as:

The pattern I have seen very consistently is two reactions: a headache from the brain frantically trying to unlearn the bad ideas from everything they previously did, and a smile from understanding the potential of what we are suggesting

Qi4j is still very new and unstable. At this point they are working on stabilizing the framework and trying to get the ideas of Composite Oriented Programming developed and presented to the community. They admit that they are not quite ready for people to dive in to the framework, and suggest people focus on understanding the concepts for the next couple months.

New Energy for Java by Rickard Öberg Posted Nov 17, 2007 6:10 AM
Re: New Energy for Java by Shawn Q Posted Nov 19, 2007 3:12 AM
Re: New Energy for Java by Rickard Öberg Posted Nov 19, 2007 6:46 AM
Re: New Energy for Java by Joubin Houshyar Posted Jan 7, 2008 2:18 PM
  1. Back to top

    New Energy for Java

    Nov 17, 2007 6:10 AM by Rickard Öberg

    I've posted some thoughts on this on my (reopened and renamed) blog:
    www.jroller.com/rickard/entry/reloaded_the_cont...

    Much more to do, but as pointed out above and on the mailing list, what we are mostly interested in at this point is to attract others who want to significantly improve the current state of application development. We want thinkers, not coders.

    We estimate that it will not be ready for use in production until some time later next year. But things are progressing at a furious rate, more than even I had anticipated myself, so it's difficult to make any useful time estimates.

  2. Back to top

    Re: New Energy for Java

    Nov 19, 2007 3:12 AM by Shawn Q

    Cool!
    Is this the evolution of your extreme AOP idea ?

  3. Back to top

    Re: New Energy for Java

    Nov 19, 2007 6:46 AM by Rickard Öberg

    Yes, and then some :-)

  4. Back to top

    Re: New Energy for Java

    Jan 7, 2008 2:18 PM by Joubin Houshyar

    Hi Rickard,

    1 - Review the VS C# component model. The use of ISite is an improvement over BeanContext.
    2 - Review Simonyi. [www.intentsoft.com/]
    3 - It is not clear why you distinguish between Components and 'fragments'. Please elaborate.

    The key to this holy grail is Semantic Adaptation. Contextual composition is (clearly) important, but it will not solve the problem.

    Think illiterates assembling Laptops.


    /Regards

    "J"

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.