Packages

object Composite_In_3_Factory2 extends Composite_In_3_Factory2

Source
Composite_In_3_Factory.scala
Linear Supertypes
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Composite_In_3_Factory2
  2. Composite_In_3_Factory2
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. macro def m[I1, I2, I3, T1, T2](dsl: Composite_In_3_02[I1, I2, I3, T1, T2]): InputMolecule_3_02[I1, I2, I3, T1, T2]

    Macro creation of composite input molecule awaiting 3 inputs from user-defined DSL with 2 output groups (arity 2).

    Macro creation of composite input molecule awaiting 3 inputs from user-defined DSL with 2 output groups (arity 2).

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the + method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Applying the ? marker to attributes changes the semantics of the composite molecule to become a "composite input molecule" that awaits input at runtime for the attributes marked with ?.

    Once the composite input molecule models the desired data structure and has been resolved with input we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `age`, `score` and `flags` attributes to create composite input molecule
    val personsAgeScoreFlags = m(Person.name.age_(?) + Tag.score_(?).flags_(?))
    
    // At runtime, `age`, `score` and `flags` values are applied to get the Person's name
    personsAgeScoreFlags(42, 7, 3).get.head === "Ben"

    Composite molecules of arity 2 has two sub-molecules with output attribute(s). If a sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value. The two groups of either a single type or tuple are then tied together in an outer composite tuple:

    Composite input molecule               Composite type (2 output groups)
    
    A.a1.a2_(?) + B.b1(?).b2_(?)     =>    (a1, b1)
    A.a1.a2_(?) + B.b1(?).b2(?)      =>    (a1, (b1, b2))
    A.a1.a2(?)  + B.b1(?).b2_(?)     =>    ((a1, a2), b1)
    A.a1.a2(?)  + B.b1(?).b2(?)      =>    ((a1, a2), (b1, b2)) etc...
    
    We could even have additional non-output sub-molecules:
    A.a1.a2(?) + B.b1(?).b2 + C.c1_(?)     =>    ((a1, a2), (b1, b2)) etc...

    Translating into the example:

    m(Person.name.age_(?) + Tag.score(?).flags_(?))(42, 7, 3).get.head === ("Ben", 7)
    m(Person.name.age_(?) + Tag.score(?).flags(?) )(42, 7, 3).get.head === ("Ben", (7, 3))
    m(Person.name.age(?)  + Tag.score(?).flags_(?))(42, 7, 3).get.head === (("Ben", 42), 7)
    m(Person.name.age(?)  + Tag.score(?).flags(?) )(42, 7, 3).get.head === (("Ben", 42), (7, 3))
    
    m(Person.name.age(?) +
      Tag.score(?).flags +
      Cat.name_(?))(42, 7, "pitcher").get.head === (("Ben", 42), (7, 3))
    I1

    Type of input attribute 1 (age: Int)

    I2

    Type of input attribute 2 (score: Int)

    I3

    Type of input attribute 3 (flags: Int)

    T1

    Type of output group 1

    T2

    Type of output group 2

    dsl

    User-defined DSL structure modelling the composite input molecule awaiting 3 inputs

    returns

    Composite input molecule awaiting 3 inputs

    Definition Classes
    Composite_In_3_Factory2
  13. macro def m[I1, I2, I3, T1](dsl: Composite_In_3_01[I1, I2, I3, T1]): InputMolecule_3_01[I1, I2, I3, T1]

    Macro creation of composite input molecule awaiting 3 inputs from user-defined DSL with 1 output group (arity 1).

    Macro creation of composite input molecule awaiting 3 inputs from user-defined DSL with 1 output group (arity 1).

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the + method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Applying the ? marker to attributes changes the semantics of the composite molecule to become a "composite input molecule" that awaits input at runtime for the attributes marked with ?.

    Once the composite input molecule models the desired data structure and has been resolved with input we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `age`, `score` and `flags` attributes to create composite input molecule
    val personsAgeScoreFlags = m(Person.name.age_(?) + Tag.score_(?).flags_(?))
    
    // At runtime, `age`, `score` and `flags` values are applied to get the Person's name
    personsAgeScoreFlags(42, 7, 3).get.head === "Ben"

    Composite input molecules of arity 1 has only one sub-molecule with output attribute(s). If the sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value:

    Composite input molecule                  Composite type (1 output group)
    
    A.a1(?)       + B.b1_(?).b2_(?)     =>    a1
    A.a1.a2(?)    + B.b1_(?).b2_(?)     =>    (a1, a2)
    A.a1.a2.a3(?) + B.b1_(?).b2_(?)     =>    (a1, a2, a3)
    
    A.a1_(?).a2_(?) + B.b1(?)           =>    b1
    A.a1_(?).a2_(?) + B.b1.b2(?)        =>    (b1, b2)
    A.a1_(?).a2_(?) + B.b1.b2.b3(?)     =>    (b1, b2, b3)
    
    We could even have multiple tacit sub-molecules with multiple tacit attributes
    A.a1_(?).a2_ + B.b1_(?) + C.c1.c2_(?).c3     =>    (c1, c3)

    So, given 2 output attributes, a tuple is returned:

    m(Person.name.age(?) + Tag.score_(?).flags_(?))(42, 7, 3).get.head === ("Ben", 42)
    //  A   . a1 . a2(?) +  B .   b1_(?).   b2_(?)                      => (  a1 , a2)
    I1

    Type of input attribute 1 (age: Int)

    I2

    Type of input attribute 2 (score: Int)

    I3

    Type of input attribute 3 (flags: Int)

    T1

    Type of output group

    dsl

    User-defined DSL structure modelling the composite input molecule awaiting 2 inputs

    returns

    Composite input molecule awaiting 3 inputs

    Definition Classes
    Composite_In_3_Factory2
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Composite_In_3_Factory2

Inherited from AnyRef

Inherited from Any

composite3

Ungrouped