Qi4j

  • 512 views
Uploaded on

a lighting talk that i did for Qi4j

a lighting talk that i did for Qi4j

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
512
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. QI4j
  • 2. What is● Framework● Composite Oriented Programming● DDD● Aop● DI
  • 3. Principles
  • 4. OOP is Class Oriented
  • 5. Behavior Depends on Context
  • 6. Decoupling is Virtue
  • 7. Business Rules matters more
  • 8. Solution
  • 9. Fragments
  • 10. Composite
  • 11. HelloWorldpublic interface HelloWorld extendsHelloWorldBehaviour, HelloWorldState {}
  • 12. Behaviour@Mixins( HelloWorldBehaviourMixin.class )public interface HelloWorldBehaviour{ String say();}
  • 13. Implpublic class HelloWorldBehaviourMixin implements HelloWorldBehaviour{ @This HelloWorldState state; public String say() { return state.getPhrase() + " " + state.getName(); }}
  • 14. State@Mixins( HelloWorldStateMixin.class )public interface HelloWorldState{ void setPhrase(@NotEmpty String phrase ) throws IllegalArgumentException; String getPhrase(); void setName( @NotEmpty String name ) throws IllegalArgumentException; String getName();}
  • 15. RunningTransientBuilderFactory factory =assembler.transientBuilderFactory(); HelloWorld olaMundo =factory.newTransient( HelloWorldComposite.class ); olaMundo.setName("Jeff"); olaMundo.setPhrase("adoro mac"); System.out.println( olaMundo.say() );