SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
SimpleModeler
Android     ⾃自 ⽣生
with g3/g4
2011   10⽉月15⽇日
•  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
•  JJUG CCC 2011 Fall
     •  10⽉月17⽇日(⽉月)   ⽴立立                 ⻘青
     •        Scala
     •  http://www.java-users.jp/contents/events/ccc2011fall/
        index.html
     •  http://kokucheese.com/event/index/18473/
•                          (   1   )
     •  10⽉月29⽇日(⼟土)                   (      )
     •  ⽉月
     •  http://atnd.org/events/20884
•  CSV   Android   (&Rest   )   ⽣生
⼊入⼒力力CSV
SimpleModeler     Scala DSL   CSV
                ⼊入⼒力力


 #actor,parts,attrs
 customer,,name;phone;summary
 #resource
 goods,,note
 #event
 buy,customer;goods
g3
g3
class App extends G3Application with UseRecord {
   port("/demo") invoke('ds)
   val schema_customer = Schema(
      AutoIdField,
      ('name, XString),
      ('summary, XString),                          SimpleModeler
      ('phone, XString))                            ⾃自 ⽣生
   val schema_goods = Schema(
      AutoIdField,
      ('name, XString),
      ('summary, XString),
      ('note, XString))
   val schema_buy = Schema(
      AutoIdField,
      ('dateTime, XDateTime),
      ('customer, XEntityReference('customer)),
      ('goods, XEntityReference('goods)))
   datastore('ds, RecordClassSpace(
         RecordClass('customer, schema_customer),
         RecordClass('goods, schema_goods),
         RecordClass('buy, schema_buy)))
}
g4
•  Android                       (Java)
  • 
  •  DI (Dependency Injection)
  • 
  •  ⾮非
•  g4
  • 
  •            (loosely coupled)          (high coherency)
  • 
  • 
  • 
  •                  (testability)
  •  ⾃自   ⽣生           ⽫皿
DI(Dependency Injection)
• 
     •  Spring
     •  Google Guice
     •  RoboGuice
          •  Android⽤用DI
          •  Guice
•                          ⼊入
     • 
     •                          ⽴立立
• 
DI   ⽅方
DI
public 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);
   }
}
DI
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());
    }

…
•  Scala⾔言
•  Java



              (Scala)

class MyListActivity extends Activity with ListViewer


class MyMapActivity extends MapActivity with
MyLocationOverlayViewer
⽅方
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());
    }

…
•  DI   ⽬目   Android
•  SimpleModeler
   •                                                  ⾃自 ⽣生
       •                     ⼟土                  ⾃自    ⽣生

  •  CSV       g3           Android               ⽣生

•  g4
   • 
   •  ⾮非
   •  DI (Dependency Injection)
       • 
       •  g4       Guice
  • 
       •                                   ⽴立立
       •  Java⾔言                      g4
END

Weitere ähnliche Inhalte

Ähnlich wie SimpleModelerによるAndroidアプリ自動生成 with g3/g4

DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編
Makoto Yamazaki
 

Ähnlich wie SimpleModelerによるAndroidアプリ自動生成 with g3/g4 (20)

Getting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle pluginGetting started with building your own standalone Gradle plugin
Getting started with building your own standalone Gradle plugin
 
getting-your-groovy-on
getting-your-groovy-ongetting-your-groovy-on
getting-your-groovy-on
 
DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編DevQuiz 2011 の模範解答 Android編
DevQuiz 2011 の模範解答 Android編
 
Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Golang Project Layout and Practice
Golang Project Layout and PracticeGolang Project Layout and Practice
Golang Project Layout and Practice
 
Grails 101
Grails 101Grails 101
Grails 101
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
 
Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...Building modular monoliths that could scale to microservices (only if they ne...
Building modular monoliths that could scale to microservices (only if they ne...
 
Using Geoscript Groovy
Using Geoscript GroovyUsing Geoscript Groovy
Using Geoscript Groovy
 
#BABBQAmsterdam The other Android getting started guide: Gradle power
#BABBQAmsterdam The other Android getting started guide: Gradle power#BABBQAmsterdam The other Android getting started guide: Gradle power
#BABBQAmsterdam The other Android getting started guide: Gradle power
 
"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson"Xapi-lang For declarative code generation" By James Nelson
"Xapi-lang For declarative code generation" By James Nelson
 
Go 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX GoGo 1.10 Release Party - PDX Go
Go 1.10 Release Party - PDX Go
 
Go for Mobile Games
Go for Mobile GamesGo for Mobile Games
Go for Mobile Games
 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
 
Dsl로 만나는 groovy
Dsl로 만나는 groovyDsl로 만나는 groovy
Dsl로 만나는 groovy
 
[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the android[DEPRECATED]Gradle the android
[DEPRECATED]Gradle the android
 
[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content[UniteKorea2013] Protecting your Android content
[UniteKorea2013] Protecting your Android content
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyond
 
Eric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyondEric Lafortune - Fighting application size with ProGuard and beyond
Eric Lafortune - Fighting application size with ProGuard and beyond
 
Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...Building Modular monliths that could scale to microservices (only if they nee...
Building Modular monliths that could scale to microservices (only if they nee...
 

Mehr von Tomoharu ASAMI

Mehr von Tomoharu ASAMI (20)

アプリケーション・アーキテクチャ 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第34回】
アプリケーション・アーキテクチャ 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第34回】アプリケーション・アーキテクチャ 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第34回】
アプリケーション・アーキテクチャ 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第34回】
 
テスト 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第33回】
テスト 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第33回】テスト 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第33回】
テスト 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第33回】
 
実装(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第32回】
実装(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第32回】実装(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第32回】
実装(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第32回】
 
実装(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第31回】
実装(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第31回】実装(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第31回】
実装(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第31回】
 
実装(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第30回】
実装(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第30回】実装(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第30回】
実装(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第30回】
 
設計/UX/UI 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第29回】
設計/UX/UI 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第29回】設計/UX/UI 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第29回】
設計/UX/UI 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第29回】
 
設計/原理 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第28回】
設計/原理 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第28回】設計/原理 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第28回】
設計/原理 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第28回】
 
設計/ドメイン設計(5) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第27回】
設計/ドメイン設計(5) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第27回】設計/ドメイン設計(5) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第27回】
設計/ドメイン設計(5) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第27回】
 
設計/ドメイン設計(4) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第26回】
設計/ドメイン設計(4) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第26回】設計/ドメイン設計(4) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第26回】
設計/ドメイン設計(4) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第26回】
 
設計/ドメイン設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第25回】
設計/ドメイン設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第25回】設計/ドメイン設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第25回】
設計/ドメイン設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第25回】
 
設計/ドメイン設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第24回】
設計/ドメイン設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第24回】設計/ドメイン設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第24回】
設計/ドメイン設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第24回】
 
設計/ドメイン設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第23回】
設計/ドメイン設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第23回】設計/ドメイン設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第23回】
設計/ドメイン設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第23回】
 
設計/コンポーネント設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第22回】
設計/コンポーネント設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第22回】設計/コンポーネント設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第22回】
設計/コンポーネント設計(3) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第22回】
 
設計/コンポーネント設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第21回】
設計/コンポーネント設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第21回】設計/コンポーネント設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第21回】
設計/コンポーネント設計(2) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第21回】
 
設計/コンポーネント設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第20回】
設計/コンポーネント設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第20回】設計/コンポーネント設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第20回】
設計/コンポーネント設計(1) 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第20回】
 
設計/アーキテクチャ設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第19回】
設計/アーキテクチャ設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第19回】設計/アーキテクチャ設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第19回】
設計/アーキテクチャ設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第19回】
 
設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第18回】
設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第18回】設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第18回】
設計 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第18回】
 
分析/イベント駆動 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第17回】
分析/イベント駆動 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第17回】分析/イベント駆動 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第17回】
分析/イベント駆動 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第17回】
 
分析/コンポーネント分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第16回】
分析/コンポーネント分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第16回】分析/コンポーネント分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第16回】
分析/コンポーネント分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第16回】
 
分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第15回】
分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第15回】分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第15回】
分析 【クラウドアプリケーションのためのオブジェクト指向分析設計講座 第15回】
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

SimpleModelerによるAndroidアプリ自動生成 with g3/g4

  • 1. SimpleModeler Android ⾃自 ⽣生 with g3/g4 2011 10⽉月15⽇日
  • 2.
  • 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. •  JJUG CCC 2011 Fall •  10⽉月17⽇日(⽉月)   ⽴立立 ⻘青 •  Scala •  http://www.java-users.jp/contents/events/ccc2011fall/ index.html •  http://kokucheese.com/event/index/18473/ •  ( 1 ) •  10⽉月29⽇日(⼟土) ( ) •  ⽉月 •  http://atnd.org/events/20884
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. •  CSV Android (&Rest ) ⽣生
  • 10. ⼊入⼒力力CSV SimpleModeler Scala DSL CSV ⼊入⼒力力 #actor,parts,attrs customer,,name;phone;summary #resource goods,,note #event buy,customer;goods
  • 11. g3
  • 12. g3 class App extends G3Application with UseRecord { port("/demo") invoke('ds) val schema_customer = Schema( AutoIdField, ('name, XString), ('summary, XString), SimpleModeler ('phone, XString)) ⾃自 ⽣生 val schema_goods = Schema( AutoIdField, ('name, XString), ('summary, XString), ('note, XString)) val schema_buy = Schema( AutoIdField, ('dateTime, XDateTime), ('customer, XEntityReference('customer)), ('goods, XEntityReference('goods))) datastore('ds, RecordClassSpace( RecordClass('customer, schema_customer), RecordClass('goods, schema_goods), RecordClass('buy, schema_buy))) }
  • 13. g4 •  Android (Java) •  •  DI (Dependency Injection) •  •  ⾮非 •  g4 •  •  (loosely coupled) (high coherency) •  •  •  •  (testability) •  ⾃自 ⽣生 ⽫皿
  • 14.
  • 15. DI(Dependency Injection) •  •  Spring •  Google Guice •  RoboGuice •  Android⽤用DI •  Guice •  ⼊入 •  •  ⽴立立 • 
  • 16. DI ⽅方
  • 17. DI public 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); } }
  • 18. DI 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()); } …
  • 19. •  Scala⾔言 •  Java (Scala) class MyListActivity extends Activity with ListViewer class MyMapActivity extends MapActivity with MyLocationOverlayViewer
  • 21. 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()); } …
  • 22. •  DI ⽬目 Android
  • 23. •  SimpleModeler •  ⾃自 ⽣生 •  ⼟土 ⾃自 ⽣生 •  CSV g3 Android ⽣生 •  g4 •  •  ⾮非 •  DI (Dependency Injection) •  •  g4 Guice •  •  ⽴立立 •  Java⾔言 g4
  • 24. END