Successfully reported this slideshow.
DIAndroid2011 10⽉月10⽇日  Lab
⾃自⼰己•  ⽇日 Java                    ⻑⾧長 ( ) Lab    edge2.cc•    •  XML SmartDoc (XML⽂文                  )   •  Relaxer (XML/...
•  Modegramming Style (           DSL           )  •  http://modegramming.blogspot.com/•  SimpleModeler  •  http://code.go...
•  JJUG CCC 2011 Fall  •  10⽉月17⽇日(⽉月)   ⽴立立                 ⻘青  •        Scala  •  http://www.java-users.jp/contents/even...
•  CSV   Android   (&Rest   )   ⽣生
g4•  Android                     (Java)  •  DI (Dependency Injection)  •   •  ⾮非•  g4  •   •          (loosely coupled)   ...
DI(Dependency Injection)•      •  Spring     •  Googl Guice     •  RoboGuice          •  Android⽤用DI          •  Guice•   ...
DI   ⽅方
DIpublic class DemoModule extends GModule {  public DemoModule(GContext context) {     super(context);  }   @Override   pr...
DIpublic class CustomerRestViewActivity extends     GActivity<DemoController> {  @LayoutView(R.id.header)  TextView mHeade...
•  Scala⾔言•  Java•            (Scala)class MyListActivity extends Activity with ListViewerclass MyMapActivity extends MapA...
⽅方
public class CustomerRestViewActivity extends     GActivity<DemoController> {  @LayoutView(R.id.header)  TextView mHeader;...
•  DI   ⽬目   Android
•  DI (Dependency Injection)     •      •  g4       Guice•      •                              ⽴立立     •  Java⾔言          ...
END
DIとトレイとによるAndroid開発の効率化
DIとトレイとによるAndroid開発の効率化
Upcoming SlideShare
Loading in …5
×

DIとトレイとによるAndroid開発の効率化

2,210 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

DIとトレイとによるAndroid開発の効率化

  1. 1. DIAndroid2011 10⽉月10⽇日 Lab
  2. 2. ⾃自⼰己•  ⽇日 Java ⻑⾧長 ( ) Lab edge2.cc•  •  XML SmartDoc (XML⽂文 ) •  Relaxer (XML/Java )•  •  SimpleModeler (Scala DSL ) •  g3 ( )•  •  ⼯工 UML (⽇日 BP) •  ( ) •  Scala (Softbank Creative)
  3. 3. •  Modegramming Style ( DSL ) •  http://modegramming.blogspot.com/•  SimpleModeler •  http://code.google.com/p/simplemodeler/•  g3 •  http://code.google.com/p/goldenport3/•  g4 •  https://github.com/asami/goldenport-android-library
  4. 4. •  JJUG CCC 2011 Fall •  10⽉月17⽇日(⽉月)   ⽴立立 ⻘青 •  Scala •  http://www.java-users.jp/contents/events/ccc2011fall/ index.html •  http://kokucheese.com/event/index/18473/
  5. 5. •  CSV Android (&Rest ) ⽣生
  6. 6. g4•  Android (Java) •  DI (Dependency Injection) •  •  ⾮非•  g4 •  •  (loosely coupled) (high coherency) •  •  •  •  (testability)
  7. 7. DI(Dependency Injection)•  •  Spring •  Googl Guice •  RoboGuice •  Android⽤用DI •  Guice•  ⼊入 •  •  ⽴立立• 
  8. 8. DI ⽅方
  9. 9. DIpublic class DemoModule extends GModule { public DemoModule(GContext context) { super(context); } @Override protected void configure() { configure_context(); bind(DemoContext.class).toInstance((DemoContext)gcontext); bind(GErrorModel.class).to(DemoErrorModel.class).in(Singleton.class); bind(GModel.class).to(DemoModel.class).in(Singleton.class); bind(GAgent.class).to(DemoAgent.class).in(Singleton.class); bind(GController.class).to(DemoController.class); bind(IDemoRestDriver.class).to(DemoG3Driver.class); }}
  10. 10. DIpublic class CustomerRestViewActivity extends GActivity<DemoController> { @LayoutView(R.id.header) TextView mHeader; @ResourceString(R.string.header) String mHeaderLabel; @ResourceColor(R.color.header) Color mHeaderColor; @IntentExtra("message") String mMessage; public CustomerRestViewActivity() { addTrait(new ListViewTrait()); }…
  11. 11. •  Scala⾔言•  Java•  (Scala)class MyListActivity extends Activity with ListViewerclass MyMapActivity extends MapActivity withMyLocationOverlayViewer
  12. 12. ⽅方
  13. 13. public class CustomerRestViewActivity extends GActivity<DemoController> { @LayoutView(R.id.header) TextView mHeader; @ResourceString(R.string.header) String mHeaderLabel; @ResourceColor(R.color.header) Color mHeaderColor; @IntentExtra("message") String mMessage; public CustomerRestViewActivity() { addTrait(new ListViewTrait()); }…
  14. 14. •  DI ⽬目 Android
  15. 15. •  DI (Dependency Injection) •  •  g4 Guice•  •  ⽴立立 •  Java⾔言 g4
  16. 16. END

×