3

From where I can get Composite Oriented Programming Framework in scala -- Qi4j or similar?

For reference : www.qi4j.org

What is Qi4j™? - [Brief Introduction taken from www.qi4j.org]

The short answer is that Qi4j™ is a framework for domain centric application development, including evolved concepts from AOP, DI and DDD.

Qi4j™ is an implementation of Composite Oriented Programming, using the standard Java 5 platform, without the use of any pre-processors or new language elements. Everything you know from Java 5 still applies and you can leverage both your experience and toolkits to become more productive with Composite Oriented Programming today.

Moreover, Qi4j™ enables Composite Oriented Programming on the Java platform, including both Java and Scala as primary languages as well as many of the plethora of languages running on the JVM as bridged languages.

Optimight
  • 2,989
  • 6
  • 30
  • 48
  • 1
    Take a look at traits (or /and the cake pattern). Some things you can do in Qi4j can be done with those ... – Jan Jun 15 '12 at 14:31
  • @Jan Do you have any scala code sample where traits can be changed during runtime? – Optimight Jun 15 '12 at 15:27
  • Traits can not be changed during runtime. As I said you can do *some* things. ;-) – Jan Jun 16 '12 at 08:08

2 Answers2

1

Take a look at this answer to see why you can't change traits during runtime.

In order to change (or select) behavior dynamically: Maybe you take a look at type classes or implicit conversions.

Regards, Jan

Community
  • 1
  • 1
Jan
  • 1,767
  • 16
  • 18
1

Qi4j 2.0 (in the works) adds strong Scala support, and we are working on making Scala Traits useful as Qi4j mixins and concerns (AOP "around advice" equivalents). The Scala trait compiles down to static methods that takes a proxy instance of the owning class as the first argument (classic C++ representation in C). Qi4j will be able to wire up the Trait as a Mixin (i.e. the methods can be exposed in the Composite's public interface) and bind in the underlying StateHolder for the composite to be used by the Trait, so it seems that traits will have state...

FTR; Qi4j 2.0 is also minimizing the type footprint, allowing for Qi4j-agnostic types to be used even more than before.

eskatos
  • 4,174
  • 2
  • 40
  • 42