object-funcational analysis and design

33
Object-Functional Analysis and Design 次世代モデリングパラダイムを考える 2012528 JJUG 浅海智晴 (@asami224)

Upload: tomoharu-asami

Post on 27-May-2015

2.958 views

Category:

Documents


3 download

TRANSCRIPT

  • 1. Object-Functional!Analysis and Design!2012528JJUG (@asami224)

2. Java XML SmartDoc (XML) Relaxer (XML/Java) SimpleModeler (Scala DSL) SmartDox () g3 () g4 (Android) UML(BP) () Scala(Softbank Creative) 3. 4. Modegramming Style (DSL ) http://modegramming.blogspot.com/ SimpleModeler http://github.com/asami/simplemodeler/ SmartDox http://github.com/asami/smartdox g3 http://code.google.com/p/goldenport3/ g4 http://github.com/asami/goldenport-android-library/ 5. 6. Object Functional Programming (OFP) Object Functional Analysis and Design (OFAD) 7. DSL (Domain Specific Language) DSL APIDSL 8. OFAD/ OFPOOAD OFADUCD/UX 9. DSL OO DSL OO OO 10. 11. () () 12. 20OO Haskell Scala(+scalaz) Lisp, ML, OCaml pure Lisp Parametric Subtypepolymorphism polymorphism 13. List, () ()() ( ) 14. 15. (associative law) (semigroup) (monoid) (a + b) + c = a + (b + c) (group) (commutative law) a+b=b+a () (distributive law) (ring) (field) a * (b + c) = a * b + a * c 16. (category)Hask (Scala?) (monad) (kleisli category) Applicative (arrow,functormorphism) (functor) 17. (shared mutability) STM (Software Transactional Memory) () (isolatingmutability) SQL 18. Object FunctionalProgramming (OFP) 19. OFP (trait) mix-in AOP (monad) Monadic (type class) (?) Scala 20. (1) 21. (2) 22. Arrow 23. KliesliOption/List 24. Object Functional Analysisand Design (OFAP) 25. 26. 27. 28. 29. A Unifiying ISBN: 978-0-521-11787-6Framework forStructuredYourdon(Structured Chart)DeMarco(DFD)Jackson(Structure Text)Analysis and(Initial algebra)DesignModelsSA/SDAsakusaFW http://www.asakusafw.com/DSLHadoopAsakusa DSL (http://www.asakusafw.com/wp/wp-content/uploads/2012/01/AsakusaDSLDesignMethodology.pdf)Spark http://www.spark-project.org/Apache MesosScalaScala 30. SparkScaldingval file = spark.textFile("hdfs://...")file.flatMap(line => line.split(" ")).map(word => (word, 1)) Spark.reduceByKey(_ + _)class WordCountJob(args : Args) extends Job(args) {TextLine( args("input") ).read. flatMap(line -> word) { line : String => line.split("s+") }. groupBy(word) { _.size }. write( Tsv( args("output") ) )}Scalding https://github.com/twitter/scalding CascadingScala DSL Collection APIHadoop 31. Enterprise IntegrationPatterns (EIP) Apache Camel Enterprise Integration Patterns http://camel.apache.org/enterprise-integration- patterns.htmlRouteBuilder builder = new RouteBuilder() {public void configure() { errorHandler(deadLetterChannel("mock:error")); from("seda:a").choice() .when(header("foo").isEqualTo("bar")).to("seda:b") .when(header("foo").isEqualTo("cheese")).to("seda:c") .otherwise().to("seda:d"); }}; 32. DSL OOP OOAD+OOP+FP DSL 33. END