SlideShare uma empresa Scribd logo
1 de 60
DDD + Scala
        (@j5ik2o)
DDD   , Scala       , DSL   ,    ...

DDD             2     (4,5,6 )

@j5ik2o
agenda
Scala    DDD

 Scala

 DDD + Scala
                        DSL
 JavaBeans
Scala
Scala


Scala
    .scala   .class
    Java
Scala vs Java
  Money            Scala                 }
                                         public BigDecimal getAmount() {
case class Money(amount :
BigDecimal, currency : Currency)             return amount;
  Money            Java                  }

public class Money {                     public Currency getCurrency() {

   private final BigDecimal amount;       return currency;
                                         }
   private final Currency currency;
   public Money(BigDecimal amnt,         / equals, hashCode
                                          /
Currency creny) {                              (ry
      amount = amt;
                                     }
      currency = creny;
Hello, World!!
object HelloWorld{
    def main(args: Array[String]):Unit = {
        println(“Hello, World!!”)
    }
}
val
scala> val name = "Junichi Kato"
name: java.lang.String = Junichi Kato


scala> name = "JUNICHI KATO"
<console>:6: error: reassignment to val
    name = "JUNICHI KATO"
var
scala> var name = "Junichi Kato"
name: java.lang.String = Junichi Kato


scala> name = "JUNICHI KATO"
name: java.lang.String = JUNICHI KATO
type
scala> val name = "Junichi Kato"
name: java.lang.String = Junichi Kato


scala> val name:String = "Junichi Kato"
name: String = Junichi Kato

scala> val num:Number = 100L
num: java.lang.Number = 100
method
def add(a:Int, b:Int):Int = {
    return a + b
}
def add(a:Int, b:Int):Int = a + b
def add(a:Int, b:Int) = a + b
hoge.add(1, 2) / 3
                /
if & for
if
val a = 10
val ret = if (a % 2 == 0) true else false
val ret = if (a % 2 == 0) { println(“     ”); true }
else { println(“     ”); false }
def isEven(n: Int) = if (n % 2 == 0) true else false
for
for(i <- 1 to 3) println(i) / 1,2,3
                             /
for(i <- Array(1,2,3)) println(i) / 1,2,3
                                   /
val numbers = for(i <- 1 to 10) yield i
class
class PersonName
(fn: String, ln: String){
    require(fn.length > 0) //           IAE

    require(ln.length > 0) //          IAE

    val firstName = fn
    val lastName = ln
    def fullName = “%s, %s”.format(firstName, lastName)
}
class


class PersonName(val firstName:String, val
lastName: String){
require(firstName.length > 0)
require(lastName.length > 0)
def fullName = “%s, %s”.format(firstName,
lastName)
class
val pn = new PersonName(“Junichi”, “Kato”)
println(pn.fullName)
val pn2 = new PersonName(“”, “Kato”) / IAE
                                      /
object
object EmployeeDao {
    val DEFAULT_NAME = ...
    def findAll = ...
}
val result = EmployeeDao.findAll
val defaultName = EmployeeDao.DEFAULT_NAME
{               ,                }


class Money(val amount:BigDecimal, val currency: Currency) ...


object Money {
    val JPY = Currency.getInstance(“JPY”)
 def apply(amount: BigDecimal, currency: Currency) = new
Money(amount, currency)
}
val money:Money = Money(100, Money. JPY)
/ val money:Money = Money.apply(100, Money.JPY)
 /
match
def numberMatch(n:Int) = n match {
    case 1 => “one”
    case 2 | 3 => “t wo or three”
    case _ => “other”
}
println(numberMatch(1)) / one
                         /
println(numberMatch(2)) / t wo or three
                         /
println(numberMatch(3)) / t wo or three
                         /
println(numberMatch(4)) / other
                         /
match
val pattern = """([a-z]+)""".r               case Array(1,2,3) => println(“
def matchTest(word: Any) = word                         1,2,3     ”)
match {
                                           case _ => throw new
 case “ABC” => println(“ABC        ”)    IllegalArgumentException
 case pattern(s) => println("            }
                         = "+s)          matchTest(“ABC”) / ABC
                                                           /

 case s: String => println(“             matchTest("aaaa") //                 =
  = (%s)”.format(s))                     (aaaa)

 case n: Int if (n >= 2) => println(“2   matchTest(10) / 2
                                                        /
                    ”)
                                         matchTest(Array(1,2,3)) //
                                                      1,2,3
(a:Int) => a * a
val square: (Int) => Int = (a:Int) => a * a
val square = (a:Int) => a * a
val result = square(2) / 4
                        /
object MyMath {
  def add(a:Int, b:Int) = a + b
}
val f1 = MyMath.add _
val f2: (Int,Int) => Int = MyMath.add
Collection
val il1 = List(1,2,3)
val il2 = list :+ 4 / 1,2,3,4
                     /
val im1 = Map(1 -> “ 2 -> “b”, 3 -> “c”)
                   a”,
val im2 = m1 + (4 -> “d”) / 1 -> “ 2 -> “b”, 3 -> “c”, 4 -> “d”
                           /     a”,


val ml = ListBuffer(1,2,3)
ml += 4
val mm = collection.mutalble.Map(1 -> “ 2 -> “b”, 3 -> “c”)
                                      a”,
mm += (4 -> “d”)
Collection
val numbers = List(1,2,3,45)
numbers.foreach((n:Int) => println(n) ) / (1)
                                         /
numbers.foreach(n => println(n)) / (2)
                                  /
numbers.foreach(_ => println(_)) / (3)
                                  /
numbers.foreach(println(_)) / (4)
                             /
numbers.foreach(println) / (5)
                          /


varl map = Map(1 -> “ 2 -> “b”)
                    a”,
map.foreach(entry => println(“key = %s, value =
%s”.format(entry._1,entry._2)))
Collection
val evens = numbers.filter(_ % 2 == 0) //
numbers


val list = List(1,2,3).map(_ * 2) / 2,4,6
                                   /
Collection
Range         ( (Seq)                     )
val range = 1 to 10; range.foreach(println)
for(i <- 1 to 10 by 2) println(i) / 1 3 5 7 9
                                   /
6             FizzBuzz
(1 to 100).map{
  case n if (n % 15 == 0) => “FizzBuzz”
  case n if (n % 3 == 0) => “Fizz”
  case n if (n % 5 == 0) => “Buzz”
  case n => n
}.foreach(println)
trait
trait Greeting { def greet:Unit }
class JapaneseGreeting extends Greeting {
 def greet = println(“            ”)
}
class EnglishGreeting extends Greeting {
  def greet = println(“Hello”)
}
mix-in
trait Logging { def log(msg: String) = println(msg) }
class Employee(name:String) extends AbstractEmployee with
Logging {
  log(“name = “+name)
}
DDD + Scala
Domain Object &
   Lifecycle
Entity
trait Entity {
    val id: String //               OK

    def equals(other: Any) = other match {
        case that: Entity => id == that.id
        case _ => false
    }
    def hashCode = id.hashCode
}
Entity
class Employee(val id: String, val name:
String)extends Entity
val kato1 = new Employee(“1”, “Junichi Kato”)
val kato2 = new Employee(“2”, “Junichi Kato”)
val kato3 = new Employee(“3”, “JUNICHI KATO”)
assert(kato1 != kato2)
assert(kato1 == kato3)
Entity with Factory
class Employee         object Employee{
(val id:String,         def apply(id:String,
                       name:String,
var name:String,       dept:Department) = new
var dept:Department)   Employee(id, name, dept)
extends Entity         }
Entity with Factory
val kato = Employee(“KATO”,
Department(“DEV”))
Value Object with Factory
class Money                         override def toString =
                                   "Money(%s, %s)".format(amount,
(val amount: BigDecimal,           currency)
val currency: Currency){           }
 override def equals(that: Any):   object Money {
Boolean = that match {
                                    def apply(amount: BigDecimal,
  case other: Money => amount ==   currency: Currency) = new
other.amount && currency ==        Money(amount, currency)
other.currency
                                    def unapply(money: Money) =
     case _ => false               Some(money.amount,
 }                                 money.currency)
 override def hashCode =           }
amount.hashCode +
currency.hashCode
Value Object with Factory
VO

assert(Money(100, Money.JPY) == Money(100, Money.JPY))
assert(Money(100, Money.JPY) != Money(105, Money.JPY))
assert(Money(100, Money.JPY) != Money(100, Money.USD))
                 unapply
val Money(amt, cry) = money1_100yen
println(“
        amount = %s, currency = %s”.format(amt, cry))
money1_100yen match { / match
                       /

case Money(amt, cry) => println(“
                                amount = %s, currency = %s”.format(amt,
cry))
case _ => ()
}
Value Object(case class)
case class Money(amount: BigDecimal, currency:
Currency)


     apply, unapply
                        val

  toString, equals, hashCode

VO                            case class Money(amount:
BigDecimal, currency: Currency) extends ValueObject
ValueObject Builder
case class PersonName(firstName: String, lastName:
String)
class PersonNameBuilder extends
ValueObjectBuidler[PersonName, PersonNameBuilder] { ... }
            VO
val personName1 = new
PersonNameBuilder().withFirstName("Junichi").withLastNa
me("Kato").build


val personName2 = new
PersonNameBuilder().withLastName(lastName.toUpperCase
).build(personName1)
Service
object TransferSer vice {
 def transfer(money: Money,
from:BankAccount, to:BankAccount) =
    to.push(from.pull(money))
}
TransferService.transfer(Money(1000,JPY),
BankAccount(“012345”),
BankAccount(“543210”))
Aggregate




class Employee(val id:String, var name:String, var dept:
Department) extends Entity
  Employee                             id, name, dept
Aggregate
          Department (               )


class Employee(val id:String, var name:String, var dept:
Department) extends Entity
class Department(val id: String, var name: String) extends Entity
val dept = Department(“1:1”, “DEV)
val emp = Employee(“1”, “KATO”, dept) / (1)
                                       /
dept.name = “SALES” / (1)
                     /
val dept = emp.dept / (2)
                     /
dept.name = “SALES” / (2)
                     /
Aggregate(Cloneable)
@cloneable                                          }
class Department(val id: String, var name:          override def clone = { / (4)
                                                                            /
String) extends Entity {
                                                  val result =
 override def clone =                           super.clone.asInstanceOf[Employee]
super.clone.asInstanceOf[Department]
                                                        result.dpt = dpt.clone
}
                                                    }
@cloneable
                                                }
class Employee(val id:String, var
                                                val dept = Department(“1:1”, “DEV”)
name:String, _dpt: Department) extends
Entity {                                        val emp = Employee(“1”, “KATO”, dept) / (1)
                                                                                       /
     private var dpt = _dpt.clone / (1)
                                   /            dept.name = “SALES”
    def dept = dpt.clone / getDept
                          /               (2)   val dept = emp.dept / (2)
                                                                     /

 def dept_= (value: Deaprtment) { //            dept.name = “SALES”
setDept                                         emp.dept = Department(“1:1”, “SALES”) / (3)
                                                                                       /

     dpt = value.clone / (3)
                        /                       val cloneEmp = emp.clone / (4)
                                                                          /
Aggregate(clone)
clone     Mix-in

@cloneable
trait EntityCloneable[T <: Entity] {
    this: Entity =>
    override def clone: T =
     super.clone.asInstanceOf[T]
}
Aggregate(clone)
class Employee
 (val id: String,
 var name: String)
  extends Entity with
EntityCloneable[Employee]
val emp = Employee(“1”, “Kato”)
val cloneEmp = emp.clone
Aggregate(Factory)
                   Factory

object Department {
    def apply(dept: Department) =
     new Department(dept, dept.name)
}
object Employee {
    def apply(emp: Employee) =
     new Employee(emp.id, emp.name, Department(emp.dept))
}
val emp = Employee(“1”, “KATO”, Department(“1:1”, “DEV”))
val cloneEmp = Employee(emp)
Repository

trait EntityResolver[T <: Entity] extends Iterable[T]
{
    def resolve(id: String): T
    def apply(id: String) = resolve(id)
    def contains(id: String): Boolean = exists(_.id == id)
    def contains(entity: T): Boolean = exists(_ == entity)
}
Repository
class EmployeeResolver extends   val er = new EmployeeResolver
EntityResolver[Employee] {
                                 val employee = er.resolve(id)
 private val employees =
                                 val employee = er(id) / er.apply
                                                        /
Map(“1” -> Employee(“1”,
                                 -> resolve
“KATO”, Department(“1:1”,
“DEV”)))                         val employee = er.contains(id)
 def resolve(id: String) =       val exists = er.exists(_.name ==
employees(id)                    “KATO”)
 def iterator =                  val employees =
employees.map(e =>               er.filter(_.name.startWith(“K”))
e._2.clone).iterator
                                 er.foreach(println)
}
Repository
trait Repository[T <: Entity] extends
EntityResolver[T] {
    def store(entity: T)
 def update(identifier: Identifier, entity:T) =
store(entity)
    def delete(identity: Identifier)
    def delete(entity: T)
}
Repository
class EmployeeRepository           / resolve, iterator ...
                                    /
extends
Repository[Employee] {         }

 private val employees =       val er = new
collection.mutalble.Map.emp    EmployeeRepository
ty[String, Employee]           val emp = Employee(id,
 def store(emp: Employee) =    “KATO”, Department(“DEV))
employees += (emp.id -> emp)   er.store(emp)
 def delete(id: String) =      er(id) = emp
employee -= emp.id
                               er.delete(id)
 def delete(emp: Employee) =
delete(emp.id)                 er.delete(emp)
(         )=


id(4a74c322-08ab-450b-b674-793e1d7f399a) = class
Department {
    package = dept
    fields {
        name = java.lang.String
    }
}
package dept;
public class Department {
    private java.lang.String name;
    public void setName(java.lang.String name){
        this.name = name;
    }
    public java.lang.String getName(){
        return name;
    }
}
(.ftl)
<#if classMeta.getPackageName()??>            <#assign getter = "is"/>
package ${classMeta.getPackageName()};        <#elseif f.getTypeName() ==
                                              "java.lang.Boolean">
</#if>
                                              <#assign getter = "is"/>
public class ${classMeta.getName()} {
                                              <#else>
<#list classMeta.getFieldMetas() as f>
                                              <#assign getter = "get"/>
    private ${f.getTypeName()} $
{f.getName()};                                </#if>
     public void set${f.getName()?cap_first}       public ${f.getTypeName()} ${getter}$
(${f.getTypeName()} ${f.getName()}){          {f.getName()?cap_first}(){
        this.${f.getName()} = $                          return ${f.getName()};
{f.getName()};
                                                  }
   }
                                              </#list>
                                              }
<#if f.getTypeName() == "boolean">
codegen -h


codegen -c sample.config -t template -e export


codegen -c [4a74c322-08ab-450b-
b674-793e1d7f399a]@sample.config -t
template -e export
ClassMeta

              FieldMeta

          CodeGenSer vice



Factory

          ClassMetaRepository
ClassMeta Entity
package codegen.domain
class ClassMeta
(@BeanProperty val identifier: Identifier, @BeanProperty val name:
String,
 val packageName: Option[String], val fieldMetas: List[FieldMeta])
extends Entity {
 override def toString: String = "ClassMeta(%s, %s, %s,
%s)".format(identifier, name, packageName, fieldMetas)
 def getPackageName(): String = if (packageName.isEmpty) null else
packageName.get
    def getFieldMetas(): java.util.List[FieldMeta] = fieldMetas.asJava
}
ClassMeta Object
object ClassMeta {
 def apply(identifier: Identifier, name: String, packageName: Option[String],
fieldMetas: List[FieldMeta]) =
     new ClassMeta(identifier, name, packageName, fieldMetas)
def apply(name: String, packageName: Option[String], fieldMetas:
List[FieldMeta]): ClassMeta =
    apply(Identifier(), name, packageName, fieldMetas)
    def apply(classMeta: ClassMeta): ClassMeta =
   apply(classMeta.identifier, classMeta.name, classMeta.packageName,
classMeta.fieldMetas)
    def unapply(classMeta: ClassMeta) =
   Some(classMeta.identifier, classMeta.name, classMeta.packageName,
classMeta.fieldMetas)
}
FieldMeta VO & VO Factory
case class FieldMeta(@BeanProperty name:
String, @BeanProperty typeName: String)
ClassMetaRepository
package codegen.domain
class ClassMetaRepository(configSource: BufferedSource)
extends EntityResolver[ClassMeta] {
 private val classMetas = new
ModelParser().parse(configSource)
  private val classMetaMap = classMetas.map(classMeta =>
(classMeta.identifier, classMeta)).toMap
 def iterator: Iterator[ClassMeta] =
classMetaMap.map(classMeta => ClassMeta(_._2)).iterator
 def resolve(identifier: Identifier): ClassMeta =
ClassMeta(classMetaMap(identifier))
}
CodeGenSer vice
package codegen.domain                                   val exportClassDir =
                                                    getExportClassDir(classMeta)
object CodeGenSer vice{
                                                              exportClassDir.mkdirs
 def generate(exportDir: File, templateDir: File,
classMetas: List[ClassMeta],                              using(new FileWriter(new
                                                    File(exportClassDir, classMeta.name + ".java"))) {
   beginHandler: Option[(ClassMeta) => Unit],
                                                               fileWriter =>
   endHandler: Option[(ClassMeta) => Unit] ) = {
                                                           template.process(rootMap.asJava,
  val configuration = new Configuration               fileWriter);
                                                                fileWriter.flush();
configuration.setDirectoryForTemplateLoading(te
mplateDir)                                                    } / using
                                                                 /
  val template =                                              / ...
                                                               /
configuration.getTemplate("java.ftl")
                                                            } / foreach
                                                               /
  classMetas.foreach {
                                                        }
   classMeta =>
                                                    / ...
                                                     /
    / ...
     /
                                                    }
     val rootMap = Map("classMeta" ->
classMeta)
Application
package codegen.application                               getExportDir(parameters),
object Application extends Logging {                      getIdList(parameters))
 def main(args: Array[String]) {                     }
  try {
    val commandLine = new                        } catch {
CommandLineParser().parse(args.mkSt
ring(" "))                                   case e:
                                         CommandLineParseException =>
   commandLine match {                   println("
      case Help() => println("""-c                       ")
[[id1,id2]@]file.config [-t templateDir]
[-e exportDir]""")                               }
    case parameters: Parameters =>           }
generate(getConfigFile(parameters),
      getTemplateDir(parameters),        }
Application
 private def generate(configFile: File,                   CodeGenSer vice.generate(exportDir, templateDir,
                                                      targets,
                   templateDir: File,
                                                      Some({
                   exportDir: File,
                                                                c => info("id(%s) : class %s
                   ids: List[String]) {
                                                                ".format(c.identifier.value, c.name))
  info("
= %s,                                        = %s,             }),
               = %s".format(configFile, templateDir,             Some({
exportDir))                                                          c => info("id(%s) : class %s
   val repos = new                                                    ".format(c.identifier.value, c.name))
ClassMetaRepository(Source.fromFile(configFile))
                                                                }))
  val targets = ids match {
                                                               info("                                        ")
      case Nil => repos.toList
      case xs => xs.map {                                  } catch {
          e => repos.resolve(Identifier(e))                     case e: Exception => error("
      }                                                                    ", e)
  }                                                        }
  try {                                                }

Mais conteúdo relacionado

Mais procurados

Object Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in PythonObject Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in Python
Tendayi Mawushe
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
Garth Gilmour
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
Mike Fogus
 

Mais procurados (20)

Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
FunScript 2013 (with speakers notes)
FunScript 2013 (with speakers notes)FunScript 2013 (with speakers notes)
FunScript 2013 (with speakers notes)
 
Object Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in PythonObject Orientation vs Functional Programming in Python
Object Orientation vs Functional Programming in Python
 
Rust ⇋ JavaScript
Rust ⇋ JavaScriptRust ⇋ JavaScript
Rust ⇋ JavaScript
 
PHP Language Trivia
PHP Language TriviaPHP Language Trivia
PHP Language Trivia
 
响应式编程及框架
响应式编程及框架响应式编程及框架
响应式编程及框架
 
Python 표준 라이브러리
Python 표준 라이브러리Python 표준 라이브러리
Python 표준 라이브러리
 
Lecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of TwenteLecture on Rubinius for Compiler Construction at University of Twente
Lecture on Rubinius for Compiler Construction at University of Twente
 
Grammarware Memes
Grammarware MemesGrammarware Memes
Grammarware Memes
 
Introduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in HaskellIntroduction to ad-3.4, an automatic differentiation library in Haskell
Introduction to ad-3.4, an automatic differentiation library in Haskell
 
Kotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasureKotlin on Android: Delegate with pleasure
Kotlin on Android: Delegate with pleasure
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 World
 
Python programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphismPython programming : Inheritance and polymorphism
Python programming : Inheritance and polymorphism
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
 
Advanced Python, Part 1
Advanced Python, Part 1Advanced Python, Part 1
Advanced Python, Part 1
 
Your code sucks, let's fix it
Your code sucks, let's fix itYour code sucks, let's fix it
Your code sucks, let's fix it
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Pyimproved again
Pyimproved againPyimproved again
Pyimproved again
 
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 

Semelhante a ddd+scala

Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
Loïc Descotte
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
parag978978
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
 

Semelhante a ddd+scala (20)

Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)
 
Scala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar ProkopecScala presentation by Aleksandar Prokopec
Scala presentation by Aleksandar Prokopec
 
Miracle of std lib
Miracle of std libMiracle of std lib
Miracle of std lib
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
Php & my sql
Php & my sqlPhp & my sql
Php & my sql
 
ハイブリッド言語Scalaを使う
ハイブリッド言語Scalaを使うハイブリッド言語Scalaを使う
ハイブリッド言語Scalaを使う
 
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFrom Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf Milan
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Scala taxonomy
Scala taxonomyScala taxonomy
Scala taxonomy
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2
 
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developersSoftshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
 
A bit about Scala
A bit about ScalaA bit about Scala
A bit about Scala
 
Benefits of Kotlin
Benefits of KotlinBenefits of Kotlin
Benefits of Kotlin
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 

Mais de 潤一 加藤 (6)

Sbt職人のススメ
Sbt職人のススメSbt職人のススメ
Sbt職人のススメ
 
Scala with DDD
Scala with DDDScala with DDD
Scala with DDD
 
Actor&stm
Actor&stmActor&stm
Actor&stm
 
第一回Scala会議
第一回Scala会議第一回Scala会議
第一回Scala会議
 
第1回 チキチキ『( ゜ェ゜)・;'.、ゴフッ』 - シングルトンパターン(Java)
第1回 チキチキ『( ゜ェ゜)・;'.、ゴフッ』 - シングルトンパターン(Java)第1回 チキチキ『( ゜ェ゜)・;'.、ゴフッ』 - シングルトンパターン(Java)
第1回 チキチキ『( ゜ェ゜)・;'.、ゴフッ』 - シングルトンパターン(Java)
 
コードで学ぶドメイン駆動設計入門
コードで学ぶドメイン駆動設計入門コードで学ぶドメイン駆動設計入門
コードで学ぶドメイン駆動設計入門
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+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@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+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...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

ddd+scala

  • 1. DDD + Scala (@j5ik2o)
  • 2. DDD , Scala , DSL , ... DDD 2 (4,5,6 ) @j5ik2o
  • 3. agenda Scala DDD Scala DDD + Scala DSL JavaBeans
  • 5. Scala Scala .scala .class Java
  • 6. Scala vs Java Money Scala } public BigDecimal getAmount() { case class Money(amount : BigDecimal, currency : Currency) return amount; Money Java } public class Money { public Currency getCurrency() { private final BigDecimal amount; return currency; } private final Currency currency; public Money(BigDecimal amnt, / equals, hashCode / Currency creny) { (ry amount = amt; } currency = creny;
  • 7. Hello, World!! object HelloWorld{ def main(args: Array[String]):Unit = { println(“Hello, World!!”) } }
  • 8. val scala> val name = "Junichi Kato" name: java.lang.String = Junichi Kato scala> name = "JUNICHI KATO" <console>:6: error: reassignment to val name = "JUNICHI KATO"
  • 9. var scala> var name = "Junichi Kato" name: java.lang.String = Junichi Kato scala> name = "JUNICHI KATO" name: java.lang.String = JUNICHI KATO
  • 10. type scala> val name = "Junichi Kato" name: java.lang.String = Junichi Kato scala> val name:String = "Junichi Kato" name: String = Junichi Kato scala> val num:Number = 100L num: java.lang.Number = 100
  • 11. method def add(a:Int, b:Int):Int = { return a + b } def add(a:Int, b:Int):Int = a + b def add(a:Int, b:Int) = a + b hoge.add(1, 2) / 3 /
  • 12. if & for if val a = 10 val ret = if (a % 2 == 0) true else false val ret = if (a % 2 == 0) { println(“ ”); true } else { println(“ ”); false } def isEven(n: Int) = if (n % 2 == 0) true else false for for(i <- 1 to 3) println(i) / 1,2,3 / for(i <- Array(1,2,3)) println(i) / 1,2,3 / val numbers = for(i <- 1 to 10) yield i
  • 13. class class PersonName (fn: String, ln: String){ require(fn.length > 0) // IAE require(ln.length > 0) // IAE val firstName = fn val lastName = ln def fullName = “%s, %s”.format(firstName, lastName) }
  • 14. class class PersonName(val firstName:String, val lastName: String){ require(firstName.length > 0) require(lastName.length > 0) def fullName = “%s, %s”.format(firstName, lastName)
  • 15. class val pn = new PersonName(“Junichi”, “Kato”) println(pn.fullName) val pn2 = new PersonName(“”, “Kato”) / IAE /
  • 16. object object EmployeeDao { val DEFAULT_NAME = ... def findAll = ... } val result = EmployeeDao.findAll val defaultName = EmployeeDao.DEFAULT_NAME
  • 17. { , } class Money(val amount:BigDecimal, val currency: Currency) ... object Money { val JPY = Currency.getInstance(“JPY”) def apply(amount: BigDecimal, currency: Currency) = new Money(amount, currency) } val money:Money = Money(100, Money. JPY) / val money:Money = Money.apply(100, Money.JPY) /
  • 18. match def numberMatch(n:Int) = n match { case 1 => “one” case 2 | 3 => “t wo or three” case _ => “other” } println(numberMatch(1)) / one / println(numberMatch(2)) / t wo or three / println(numberMatch(3)) / t wo or three / println(numberMatch(4)) / other /
  • 19. match val pattern = """([a-z]+)""".r case Array(1,2,3) => println(“ def matchTest(word: Any) = word 1,2,3 ”) match { case _ => throw new case “ABC” => println(“ABC ”) IllegalArgumentException case pattern(s) => println(" } = "+s) matchTest(“ABC”) / ABC / case s: String => println(“ matchTest("aaaa") // = = (%s)”.format(s)) (aaaa) case n: Int if (n >= 2) => println(“2 matchTest(10) / 2 / ”) matchTest(Array(1,2,3)) // 1,2,3
  • 20. (a:Int) => a * a val square: (Int) => Int = (a:Int) => a * a val square = (a:Int) => a * a val result = square(2) / 4 /
  • 21. object MyMath { def add(a:Int, b:Int) = a + b } val f1 = MyMath.add _ val f2: (Int,Int) => Int = MyMath.add
  • 22. Collection val il1 = List(1,2,3) val il2 = list :+ 4 / 1,2,3,4 / val im1 = Map(1 -> “ 2 -> “b”, 3 -> “c”) a”, val im2 = m1 + (4 -> “d”) / 1 -> “ 2 -> “b”, 3 -> “c”, 4 -> “d” / a”, val ml = ListBuffer(1,2,3) ml += 4 val mm = collection.mutalble.Map(1 -> “ 2 -> “b”, 3 -> “c”) a”, mm += (4 -> “d”)
  • 23. Collection val numbers = List(1,2,3,45) numbers.foreach((n:Int) => println(n) ) / (1) / numbers.foreach(n => println(n)) / (2) / numbers.foreach(_ => println(_)) / (3) / numbers.foreach(println(_)) / (4) / numbers.foreach(println) / (5) / varl map = Map(1 -> “ 2 -> “b”) a”, map.foreach(entry => println(“key = %s, value = %s”.format(entry._1,entry._2)))
  • 24. Collection val evens = numbers.filter(_ % 2 == 0) // numbers val list = List(1,2,3).map(_ * 2) / 2,4,6 /
  • 25. Collection Range ( (Seq) ) val range = 1 to 10; range.foreach(println) for(i <- 1 to 10 by 2) println(i) / 1 3 5 7 9 / 6 FizzBuzz (1 to 100).map{ case n if (n % 15 == 0) => “FizzBuzz” case n if (n % 3 == 0) => “Fizz” case n if (n % 5 == 0) => “Buzz” case n => n }.foreach(println)
  • 26. trait trait Greeting { def greet:Unit } class JapaneseGreeting extends Greeting { def greet = println(“ ”) } class EnglishGreeting extends Greeting { def greet = println(“Hello”) } mix-in trait Logging { def log(msg: String) = println(msg) } class Employee(name:String) extends AbstractEmployee with Logging { log(“name = “+name) }
  • 28. Domain Object & Lifecycle
  • 29. Entity trait Entity { val id: String // OK def equals(other: Any) = other match { case that: Entity => id == that.id case _ => false } def hashCode = id.hashCode }
  • 30. Entity class Employee(val id: String, val name: String)extends Entity val kato1 = new Employee(“1”, “Junichi Kato”) val kato2 = new Employee(“2”, “Junichi Kato”) val kato3 = new Employee(“3”, “JUNICHI KATO”) assert(kato1 != kato2) assert(kato1 == kato3)
  • 31. Entity with Factory class Employee object Employee{ (val id:String, def apply(id:String, name:String, var name:String, dept:Department) = new var dept:Department) Employee(id, name, dept) extends Entity }
  • 32. Entity with Factory val kato = Employee(“KATO”, Department(“DEV”))
  • 33. Value Object with Factory class Money override def toString = "Money(%s, %s)".format(amount, (val amount: BigDecimal, currency) val currency: Currency){ } override def equals(that: Any): object Money { Boolean = that match { def apply(amount: BigDecimal, case other: Money => amount == currency: Currency) = new other.amount && currency == Money(amount, currency) other.currency def unapply(money: Money) = case _ => false Some(money.amount, } money.currency) override def hashCode = } amount.hashCode + currency.hashCode
  • 34. Value Object with Factory VO assert(Money(100, Money.JPY) == Money(100, Money.JPY)) assert(Money(100, Money.JPY) != Money(105, Money.JPY)) assert(Money(100, Money.JPY) != Money(100, Money.USD)) unapply val Money(amt, cry) = money1_100yen println(“ amount = %s, currency = %s”.format(amt, cry)) money1_100yen match { / match / case Money(amt, cry) => println(“ amount = %s, currency = %s”.format(amt, cry)) case _ => () }
  • 35. Value Object(case class) case class Money(amount: BigDecimal, currency: Currency) apply, unapply val toString, equals, hashCode VO case class Money(amount: BigDecimal, currency: Currency) extends ValueObject
  • 36. ValueObject Builder case class PersonName(firstName: String, lastName: String) class PersonNameBuilder extends ValueObjectBuidler[PersonName, PersonNameBuilder] { ... } VO val personName1 = new PersonNameBuilder().withFirstName("Junichi").withLastNa me("Kato").build val personName2 = new PersonNameBuilder().withLastName(lastName.toUpperCase ).build(personName1)
  • 37. Service object TransferSer vice { def transfer(money: Money, from:BankAccount, to:BankAccount) = to.push(from.pull(money)) } TransferService.transfer(Money(1000,JPY), BankAccount(“012345”), BankAccount(“543210”))
  • 38. Aggregate class Employee(val id:String, var name:String, var dept: Department) extends Entity Employee id, name, dept
  • 39. Aggregate Department ( ) class Employee(val id:String, var name:String, var dept: Department) extends Entity class Department(val id: String, var name: String) extends Entity val dept = Department(“1:1”, “DEV) val emp = Employee(“1”, “KATO”, dept) / (1) / dept.name = “SALES” / (1) / val dept = emp.dept / (2) / dept.name = “SALES” / (2) /
  • 40. Aggregate(Cloneable) @cloneable } class Department(val id: String, var name: override def clone = { / (4) / String) extends Entity { val result = override def clone = super.clone.asInstanceOf[Employee] super.clone.asInstanceOf[Department] result.dpt = dpt.clone } } @cloneable } class Employee(val id:String, var val dept = Department(“1:1”, “DEV”) name:String, _dpt: Department) extends Entity { val emp = Employee(“1”, “KATO”, dept) / (1) / private var dpt = _dpt.clone / (1) / dept.name = “SALES” def dept = dpt.clone / getDept / (2) val dept = emp.dept / (2) / def dept_= (value: Deaprtment) { // dept.name = “SALES” setDept emp.dept = Department(“1:1”, “SALES”) / (3) / dpt = value.clone / (3) / val cloneEmp = emp.clone / (4) /
  • 41. Aggregate(clone) clone Mix-in @cloneable trait EntityCloneable[T <: Entity] { this: Entity => override def clone: T = super.clone.asInstanceOf[T] }
  • 42. Aggregate(clone) class Employee (val id: String, var name: String) extends Entity with EntityCloneable[Employee] val emp = Employee(“1”, “Kato”) val cloneEmp = emp.clone
  • 43. Aggregate(Factory) Factory object Department { def apply(dept: Department) = new Department(dept, dept.name) } object Employee { def apply(emp: Employee) = new Employee(emp.id, emp.name, Department(emp.dept)) } val emp = Employee(“1”, “KATO”, Department(“1:1”, “DEV”)) val cloneEmp = Employee(emp)
  • 44. Repository trait EntityResolver[T <: Entity] extends Iterable[T] { def resolve(id: String): T def apply(id: String) = resolve(id) def contains(id: String): Boolean = exists(_.id == id) def contains(entity: T): Boolean = exists(_ == entity) }
  • 45. Repository class EmployeeResolver extends val er = new EmployeeResolver EntityResolver[Employee] { val employee = er.resolve(id) private val employees = val employee = er(id) / er.apply / Map(“1” -> Employee(“1”, -> resolve “KATO”, Department(“1:1”, “DEV”))) val employee = er.contains(id) def resolve(id: String) = val exists = er.exists(_.name == employees(id) “KATO”) def iterator = val employees = employees.map(e => er.filter(_.name.startWith(“K”)) e._2.clone).iterator er.foreach(println) }
  • 46. Repository trait Repository[T <: Entity] extends EntityResolver[T] { def store(entity: T) def update(identifier: Identifier, entity:T) = store(entity) def delete(identity: Identifier) def delete(entity: T) }
  • 47. Repository class EmployeeRepository / resolve, iterator ... / extends Repository[Employee] { } private val employees = val er = new collection.mutalble.Map.emp EmployeeRepository ty[String, Employee] val emp = Employee(id, def store(emp: Employee) = “KATO”, Department(“DEV)) employees += (emp.id -> emp) er.store(emp) def delete(id: String) = er(id) = emp employee -= emp.id er.delete(id) def delete(emp: Employee) = delete(emp.id) er.delete(emp)
  • 48.
  • 49. ( )= id(4a74c322-08ab-450b-b674-793e1d7f399a) = class Department { package = dept fields { name = java.lang.String } }
  • 50. package dept; public class Department { private java.lang.String name; public void setName(java.lang.String name){ this.name = name; } public java.lang.String getName(){ return name; } }
  • 51. (.ftl) <#if classMeta.getPackageName()??> <#assign getter = "is"/> package ${classMeta.getPackageName()}; <#elseif f.getTypeName() == "java.lang.Boolean"> </#if> <#assign getter = "is"/> public class ${classMeta.getName()} { <#else> <#list classMeta.getFieldMetas() as f> <#assign getter = "get"/> private ${f.getTypeName()} $ {f.getName()}; </#if> public void set${f.getName()?cap_first} public ${f.getTypeName()} ${getter}$ (${f.getTypeName()} ${f.getName()}){ {f.getName()?cap_first}(){ this.${f.getName()} = $ return ${f.getName()}; {f.getName()}; } } </#list> } <#if f.getTypeName() == "boolean">
  • 52. codegen -h codegen -c sample.config -t template -e export codegen -c [4a74c322-08ab-450b- b674-793e1d7f399a]@sample.config -t template -e export
  • 53. ClassMeta FieldMeta CodeGenSer vice Factory ClassMetaRepository
  • 54. ClassMeta Entity package codegen.domain class ClassMeta (@BeanProperty val identifier: Identifier, @BeanProperty val name: String, val packageName: Option[String], val fieldMetas: List[FieldMeta]) extends Entity { override def toString: String = "ClassMeta(%s, %s, %s, %s)".format(identifier, name, packageName, fieldMetas) def getPackageName(): String = if (packageName.isEmpty) null else packageName.get def getFieldMetas(): java.util.List[FieldMeta] = fieldMetas.asJava }
  • 55. ClassMeta Object object ClassMeta { def apply(identifier: Identifier, name: String, packageName: Option[String], fieldMetas: List[FieldMeta]) = new ClassMeta(identifier, name, packageName, fieldMetas) def apply(name: String, packageName: Option[String], fieldMetas: List[FieldMeta]): ClassMeta = apply(Identifier(), name, packageName, fieldMetas) def apply(classMeta: ClassMeta): ClassMeta = apply(classMeta.identifier, classMeta.name, classMeta.packageName, classMeta.fieldMetas) def unapply(classMeta: ClassMeta) = Some(classMeta.identifier, classMeta.name, classMeta.packageName, classMeta.fieldMetas) }
  • 56. FieldMeta VO & VO Factory case class FieldMeta(@BeanProperty name: String, @BeanProperty typeName: String)
  • 57. ClassMetaRepository package codegen.domain class ClassMetaRepository(configSource: BufferedSource) extends EntityResolver[ClassMeta] { private val classMetas = new ModelParser().parse(configSource) private val classMetaMap = classMetas.map(classMeta => (classMeta.identifier, classMeta)).toMap def iterator: Iterator[ClassMeta] = classMetaMap.map(classMeta => ClassMeta(_._2)).iterator def resolve(identifier: Identifier): ClassMeta = ClassMeta(classMetaMap(identifier)) }
  • 58. CodeGenSer vice package codegen.domain val exportClassDir = getExportClassDir(classMeta) object CodeGenSer vice{ exportClassDir.mkdirs def generate(exportDir: File, templateDir: File, classMetas: List[ClassMeta], using(new FileWriter(new File(exportClassDir, classMeta.name + ".java"))) { beginHandler: Option[(ClassMeta) => Unit], fileWriter => endHandler: Option[(ClassMeta) => Unit] ) = { template.process(rootMap.asJava, val configuration = new Configuration fileWriter); fileWriter.flush(); configuration.setDirectoryForTemplateLoading(te mplateDir) } / using / val template = / ... / configuration.getTemplate("java.ftl") } / foreach / classMetas.foreach { } classMeta => / ... / / ... / } val rootMap = Map("classMeta" -> classMeta)
  • 59. Application package codegen.application getExportDir(parameters), object Application extends Logging { getIdList(parameters)) def main(args: Array[String]) { } try { val commandLine = new } catch { CommandLineParser().parse(args.mkSt ring(" ")) case e: CommandLineParseException => commandLine match { println(" case Help() => println("""-c ") [[id1,id2]@]file.config [-t templateDir] [-e exportDir]""") } case parameters: Parameters => } generate(getConfigFile(parameters), getTemplateDir(parameters), }
  • 60. Application private def generate(configFile: File, CodeGenSer vice.generate(exportDir, templateDir, targets, templateDir: File, Some({ exportDir: File, c => info("id(%s) : class %s ids: List[String]) { ".format(c.identifier.value, c.name)) info(" = %s, = %s, }), = %s".format(configFile, templateDir, Some({ exportDir)) c => info("id(%s) : class %s val repos = new ".format(c.identifier.value, c.name)) ClassMetaRepository(Source.fromFile(configFile)) })) val targets = ids match { info(" ") case Nil => repos.toList case xs => xs.map { } catch { e => repos.resolve(Identifier(e)) case e: Exception => error(" } ", e) } } try { }

Notas do Editor

  1. &amp;#x672C;&amp;#x65E5;&amp;#x306F;&amp;#x4F11;&amp;#x65E5;&amp;#x306B;&amp;#x3082;&amp;#x95A2;&amp;#x308F;&amp;#x3089;&amp;#x305A;&amp;#x8DB3;&amp;#x3092;&amp;#x904B;&amp;#x3093;&amp;#x3067;&amp;#x3044;&amp;#x305F;&amp;#x3060;&amp;#x304D;&amp;#x307E;&amp;#x3057;&amp;#x3066;&amp;#x3001;&amp;#x3042;&amp;#x308A;&amp;#x304C;&amp;#x3068;&amp;#x3046;&amp;#x3054;&amp;#x3056;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x967D;&amp;#x3068;&amp;#x9670;&amp;#x306E;&amp;#x3001;&amp;#x9670;&amp;#x306E;&amp;#x62C5;&amp;#x5F53;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3001;&amp;#x30DE;&amp;#x30CB;&amp;#x30A2;&amp;#x30C3;&amp;#x30AF;&amp;#x306B;Scala&amp;#x3067;DDD&amp;#x3092;&amp;#x3084;&amp;#x308B;&amp;#x306B;&amp;#x306F;&amp;#x3069;&amp;#x3046;&amp;#x3059;&amp;#x308B;&amp;#x304B;&amp;#x3063;&amp;#x3066;&amp;#x30C6;&amp;#x30FC;&amp;#x30DE;&amp;#x3067;&amp;#x3044;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  2. DDD&amp;#x7FFB;&amp;#x8A33;&amp;#x7248;&amp;#x306E;&amp;#x51FA;&amp;#x7248;&amp;#x304A;&amp;#x3081;&amp;#x3067;&amp;#x3068;&amp;#x3046;&amp;#x3054;&amp;#x3056;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x6628;&amp;#x5E74;&amp;#x306E;DevLOVE&amp;#x3067;&amp;#x548C;&amp;#x7530;&amp;#x3055;&amp;#x3093;&amp;#x306B;&amp;#x304A;&amp;#x9858;&amp;#x3044;&amp;#x3057;&amp;#x3066;&amp;#x3001;&amp;#x548C;&amp;#x667A;&amp;#x3055;&amp;#x3093;&amp;#x3092;&amp;#x7D39;&amp;#x4ECB;&amp;#x3057;&amp;#x3066;&amp;#x8CB0;&amp;#x3063;&amp;#x3066;&amp;#x3001;&amp;#x79C1;&amp;#x3068;&amp;#x96A3;&amp;#x3067;&amp;#x3084;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x90FD;&amp;#x5143;&amp;#x3055;&amp;#x3093;&amp;#x3067;2&amp;#x90E8;(4,5,6&amp;#x7AE0;)&amp;#x306E;&amp;#x30EC;&amp;#x30D3;&amp;#x30E5;&amp;#x30FC;&amp;#x3092;&amp;#x62C5;&amp;#x5F53;&amp;#x3057;&amp;#x307E;&amp;#x3057;&amp;#x305F;&amp;#x3002;\n
  3. Scala&amp;#x3067;DDD&amp;#x3092;&amp;#x3084;&amp;#x308B;&amp;#x306B;&amp;#x306F;&amp;#x3069;&amp;#x3046;&amp;#x3057;&amp;#x305F;&amp;#x3089;&amp;#x3088;&amp;#x3044;&amp;#x304B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x30C6;&amp;#x30FC;&amp;#x30DE;&amp;#x3067;&amp;#x8A71;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x307E;&amp;#x305A;&amp;#x306F;&amp;#x3001;&amp;#x307F;&amp;#x306A;&amp;#x3055;&amp;#x3093;Java&amp;#x304C;&amp;#x308F;&amp;#x304B;&amp;#x308B;&amp;#x524D;&amp;#x63D0;&amp;#x3067;Scala&amp;#x65E9;&amp;#x308F;&amp;#x304B;&amp;#x308A;&amp;#x3067;&amp;#x3056;&amp;#x3063;&amp;#x304F;&amp;#x308A;&amp;#x3068;&amp;#x89E3;&amp;#x8AAC;&amp;#x3002;\n&amp;#x305D;&amp;#x306E;&amp;#x5F8C;&amp;#x3001;DDD+Scala&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x4E3B;&amp;#x306B;DDD&amp;#x306E;2&amp;#x90E8;&amp;#x306E;&amp;#x8A71;&amp;#x3092;&amp;#x4E2D;&amp;#x5FC3;&amp;#x306B;Scala&amp;#x3067;&amp;#x3069;&amp;#x3046;&amp;#x5B9F;&amp;#x8DF5;&amp;#x3059;&amp;#x308B;&amp;#x304B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x30C6;&amp;#x30FC;&amp;#x30DE;&amp;#x3067;&amp;#x8A71;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  4. Scala&amp;#x65E9;&amp;#x308F;&amp;#x304B;&amp;#x308A;&amp;#x3002;&amp;#x7406;&amp;#x5C48;&amp;#x306F;&amp;#x305D;&amp;#x3053;&amp;#x305D;&amp;#x3053;&amp;#x306B;&amp;#x3001;&amp;#x3056;&amp;#x3063;&amp;#x304F;&amp;#x308A;&amp;#x3068;&amp;#x3069;&amp;#x3093;&amp;#x306A;&amp;#x611F;&amp;#x3058;&amp;#x3067;&amp;#x30B3;&amp;#x30FC;&amp;#x30C9;&amp;#x3092;&amp;#x66F8;&amp;#x3051;&amp;#x3070;&amp;#x3088;&amp;#x3044;&amp;#x304B;&amp;#x52D8;&amp;#x6240;&amp;#x3092;&amp;#x7D39;&amp;#x4ECB;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  5. &amp;#x6700;&amp;#x8FD1;&amp;#x6D41;&amp;#x884C;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x308B;Scala&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x4ECA;&amp;#x79C1;&amp;#x3082;&amp;#x65E5;&amp;#x7D4C;&amp;#x30BD;&amp;#x30D5;&amp;#x30C8;&amp;#x30A6;&amp;#x30A8;&amp;#x30A2;&amp;#x3067;Scala&amp;#x306E;&amp;#x7279;&amp;#x96C6;&amp;#x8A18;&amp;#x4E8B;&amp;#x3082;&amp;#x66F8;&amp;#x3044;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x3050;&amp;#x3089;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x304B;&amp;#x3089;&amp;#x3001;&amp;#x6CE8;&amp;#x76EE;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x8A00;&amp;#x8A9E;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x6CE8;&amp;#x76EE;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x7406;&amp;#x7531;&amp;#x306F;&amp;#x3044;&amp;#x308D;&amp;#x3044;&amp;#x308D;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x304C;,Scala&amp;#x306F;&amp;#x3001;&amp;#x95A2;&amp;#x6570;&amp;#x578B;&amp;#x8A00;&amp;#x8A9E;&amp;#x306E;&amp;#x6A5F;&amp;#x80FD;&amp;#x3092;&amp;#x53D6;&amp;#x308A;&amp;#x8FBC;&amp;#x3080;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3001;&amp;#x7C21;&amp;#x6F54;&amp;#x3067;&amp;#x660E;&amp;#x77AD;&amp;#x306A;&amp;#x30B3;&amp;#x30FC;&amp;#x30C7;&amp;#x30A3;&amp;#x30F3;&amp;#x30B0;&amp;#x3001;&amp;#x8A00;&amp;#x8A9E;&amp;#x81EA;&amp;#x4F53;&amp;#x306E;&amp;#x62E1;&amp;#x5F35;&amp;#x6027;&amp;#x3001;&amp;#x30D0;&amp;#x30B0;&amp;#x3092;&amp;#x4F5C;&amp;#x308A;&amp;#x8FBC;&amp;#x307F;&amp;#x306B;&amp;#x304F;&amp;#x3044;&amp;#x30D7;&amp;#x30ED;&amp;#x30B0;&amp;#x30E9;&amp;#x30DF;&amp;#x30F3;&amp;#x30B0;&amp;#x30B9;&amp;#x30BF;&amp;#x30A4;&amp;#x30EB;&amp;#x3001;&amp;#x4E26;&amp;#x884C;&amp;#x51E6;&amp;#x7406;&amp;#x5411;&amp;#x304D;&amp;#x306A;&amp;#x3069;&amp;#x3001;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x6307;&amp;#x5411;&amp;#x3068;&amp;#x306F;&amp;#x7570;&amp;#x306A;&amp;#x308B;&amp;#x7279;&amp;#x5FB4;&amp;#x3092;&amp;#x6301;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3042;&amp;#x307E;&amp;#x308A;&amp;#x8A73;&amp;#x3057;&amp;#x304F;&amp;#x8AAC;&amp;#x660E;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3053;&amp;#x308C;&amp;#x3060;&amp;#x3051;&amp;#x3067;&amp;#x7D42;&amp;#x308F;&amp;#x3063;&amp;#x3066;&amp;#x3057;&amp;#x307E;&amp;#x3046;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x3053;&amp;#x306E;&amp;#x30BB;&amp;#x30C3;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3067;&amp;#x5FC5;&amp;#x8981;&amp;#x6700;&amp;#x4F4E;&amp;#x9650;&amp;#x306E;&amp;#x77E5;&amp;#x8B58;&amp;#x3060;&amp;#x3051;&amp;#x3092;&amp;#x3044;&amp;#x308C;&amp;#x3066;Scala&amp;#x3068;DDD&amp;#x3092;&amp;#x8003;&amp;#x3048;&amp;#x3066;&amp;#x307F;&amp;#x307E;&amp;#x3057;&amp;#x3087;&amp;#x3046;&amp;#x3002;\n
  6. &amp;#x304A;&amp;#x91D1;&amp;#x3092;&amp;#x8868;&amp;#x3059;Money&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;(amount&amp;#x306F;&amp;#x304A;&amp;#x91D1;&amp;#x306E;&amp;#x91CF;, currency&amp;#x306F;&amp;#x901A;&amp;#x8CA8;&amp;#x5358;&amp;#x4F4D;)\nScala&amp;#x306F;Java&amp;#x306E;&amp;#x4E16;&amp;#x754C;&amp;#x306B;&amp;#x660E;&amp;#x77AD;&amp;#x3067;&amp;#x7C21;&amp;#x6F54;&amp;#x3092;&amp;#x3082;&amp;#x305F;&amp;#x3089;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  7. &amp;#x304A;&amp;#x306A;&amp;#x3058;&amp;#x307F;&amp;#x306A;HelloWorld&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3002;\n&amp;#x307E;&amp;#x305A;object&amp;#x304C;&amp;#x51FA;&amp;#x3066;&amp;#x304D;&amp;#x307E;&amp;#x3057;&amp;#x305F;&amp;#x3002;Java&amp;#x306B;&amp;#x306F;&amp;#x306A;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x4F55;&amp;#x304B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x3068;&amp;#x30B7;&amp;#x30F3;&amp;#x30B0;&amp;#x30EB;&amp;#x30C8;&amp;#x30F3;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30A4;&amp;#x30F3;&amp;#x30B9;&amp;#x30BF;&amp;#x30F3;&amp;#x30B9;&amp;#x304C;&amp;#x4E00;&amp;#x3064;&amp;#x3057;&amp;#x304B;&amp;#x4F5C;&amp;#x308C;&amp;#x306A;&amp;#x3044;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;&amp;#x3053;&amp;#x308C;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x3001;Scala&amp;#x3067;&amp;#x306F;static&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\ndef&amp;#x304B;&amp;#x3089;&amp;#x59CB;&amp;#x307E;&amp;#x308B;&amp;#x306E;&amp;#x304C;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;Ruby, Python&amp;#x306B;&amp;#x8FD1;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;main&amp;#x3082;static&amp;#x306A;&amp;#x3057;&amp;#x3067;&amp;#x8A18;&amp;#x8FF0;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5F15;&amp;#x6570;&amp;#x306F;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x540D;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B;&amp;#x66F8;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x578B;&amp;#x540D;&amp;#x306F;&amp;#x5909;&amp;#x6570;&amp;#x540D;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B;&amp;#x8A18;&amp;#x8FF0;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x914D;&amp;#x5217;&amp;#x306F;Array&amp;#x578B;&amp;#x3092;&amp;#x4F7F;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;[]&amp;#x306E;&amp;#x30D6;&amp;#x30E9;&amp;#x30B1;&amp;#x30C3;&amp;#x30C8;&amp;#x306F;&amp;#x30B8;&amp;#x30A7;&amp;#x30CD;&amp;#x30EA;&amp;#x30C3;&amp;#x30AF;&amp;#x30B9;&amp;#x306E;&amp;#x578B;&amp;#x5909;&amp;#x6570;&amp;#x3092;&amp;#x6307;&amp;#x5B9A;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B;&amp;#x3042;&amp;#x308B;&amp;#x306E;&amp;#x304C;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x306E;&amp;#x578B;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x95A2;&amp;#x6570;&amp;#x306E;&amp;#x672C;&amp;#x4F53;&amp;#x306F;&amp;#xFF1D;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B;&amp;#x7D9A;&amp;#x3051;&amp;#x3066;&amp;#x8A18;&amp;#x8FF0;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;public&amp;#x30AD;&amp;#x30FC;&amp;#x30EF;&amp;#x30FC;&amp;#x30C9;&amp;#x304C;&amp;#x306A;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x30C7;&amp;#x30D5;&amp;#x30A9;&amp;#x30EB;&amp;#x30C8;&amp;#x306E;&amp;#x30A2;&amp;#x30AF;&amp;#x30BB;&amp;#x30B9;&amp;#x8846;&amp;#x529B;&amp;#x3057;&amp;#x306F;public&amp;#x306A;&amp;#x306E;&amp;#x3067;&amp;#x308F;&amp;#x3056;&amp;#x308F;&amp;#x3056;&amp;#x4ED8;&amp;#x3051;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\n
  8. Scala&amp;#x3067;&amp;#x306F;val&amp;#x3068;var&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x3066;&amp;#x5909;&amp;#x6570;&amp;#x3092;&amp;#x5BA3;&amp;#x8A00;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nval&amp;#x306F;Java&amp;#x306E;final&amp;#x5909;&amp;#x6570;&amp;#x3068;&amp;#x540C;&amp;#x3058;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x518D;&amp;#x4EE3;&amp;#x5165;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x5B9A;&amp;#x6570;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;\n\n
  9. var&amp;#x306F;&amp;#x901A;&amp;#x5E38;&amp;#x306E;&amp;#x5909;&amp;#x6570;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x518D;&amp;#x4EE3;&amp;#x5165;&amp;#x53EF;&amp;#x80FD;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x95A2;&amp;#x6570;&amp;#x578B;&amp;#x30D7;&amp;#x30ED;&amp;#x30B0;&amp;#x30E9;&amp;#x30DF;&amp;#x30F3;&amp;#x30B0;&amp;#x306E;&amp;#x30B9;&amp;#x30BF;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x884C;&amp;#x3046;&amp;#x5834;&amp;#x5408;&amp;#x306F;val&amp;#x304C;&amp;#x57FA;&amp;#x672C;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3064;&amp;#x307E;&amp;#x308A;&amp;#x4E0D;&amp;#x5909;&amp;#x6027;&amp;#x3092;&amp;#x91CD;&amp;#x8996;&amp;#x3057;&amp;#x305F;&amp;#x30B9;&amp;#x30BF;&amp;#x30A4;&amp;#x30EB;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x9006;&amp;#x306B;Java&amp;#x306A;&amp;#x3069;&amp;#x306E;&amp;#x72B6;&amp;#x614B;&amp;#x3092;&amp;#x6271;&amp;#x3046;&amp;#x547D;&amp;#x4EE4;&amp;#x578B;&amp;#x30D7;&amp;#x30ED;&amp;#x30B0;&amp;#x30E9;&amp;#x30DF;&amp;#x30F3;&amp;#x30B0;&amp;#x306E;&amp;#x30B9;&amp;#x30BF;&amp;#x30A4;&amp;#x30EB;&amp;#x306E;&amp;#x5834;&amp;#x5408;&amp;#x306F;var&amp;#x3092;&amp;#x5229;&amp;#x7528;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306F;&amp;#x3069;&amp;#x3061;&amp;#x3089;&amp;#x304C;&amp;#x3044;&amp;#x3044;&amp;#x3068;&amp;#x304B;&amp;#x60AA;&amp;#x3044;&amp;#x3068;&amp;#x304B;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x3001;&amp;#x9069;&amp;#x6750;&amp;#x9069;&amp;#x6240;&amp;#x3060;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30D7;&amp;#x30ED;&amp;#x30B0;&amp;#x30E9;&amp;#x30E0;&amp;#x306E;&amp;#x308F;&amp;#x304B;&amp;#x308A;&amp;#x3084;&amp;#x3059;&amp;#x3055;&amp;#x3001;&amp;#x4E0D;&amp;#x5177;&amp;#x5408;&amp;#x3092;&amp;#x4F5C;&amp;#x308A;&amp;#x3053;&amp;#x307E;&amp;#x306A;&amp;#x3044;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x304B;&amp;#x3001;&amp;#x4E26;&amp;#x884C;&amp;#x6027;&amp;#x3092;&amp;#x91CD;&amp;#x8996;&amp;#x3059;&amp;#x308B;&amp;#x5834;&amp;#x5408;&amp;#x306F;val&amp;#x304C;&amp;#x57FA;&amp;#x672C;&amp;#x306B;&amp;#x306A;&amp;#x3063;&amp;#x3066;&amp;#x304F;&amp;#x308B;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  10. name&amp;#x306F;&amp;#x6587;&amp;#x5B57;&amp;#x5217;&amp;#x3002;&amp;#x6587;&amp;#x5B57;&amp;#x5217;&amp;#x578B;&amp;#x306F;java.lang.String&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3002;\n&amp;#x578B;&amp;#x306F;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30A4;&amp;#x30E9;&amp;#x306B;&amp;#x3088;&amp;#x3063;&amp;#x3066;&amp;#x63A8;&amp;#x8AD6;&amp;#x3055;&amp;#x308C;&amp;#x308B;&amp;#x3002;\n&amp;#x578B;&amp;#x30A2;&amp;#x30CE;&amp;#x30C6;&amp;#x30FC;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x3066;&amp;#x660E;&amp;#x793A;&amp;#x7684;&amp;#x306B;&amp;#x6307;&amp;#x5B9A;&amp;#x3067;&amp;#x304D;&amp;#x308B;\n
  11. HelloWorld&amp;#x306E;&amp;#x4F8B;&amp;#x3067;&amp;#x8AAC;&amp;#x660E;&amp;#x3057;&amp;#x305F;&amp;#x901A;&amp;#x308A;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x8DB3;&amp;#x3057;&amp;#x7B97;&amp;#x3059;&amp;#x308B;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x4F8B;&amp;#x3067;&amp;#x3059;&amp;#x3002;return a + b&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x6700;&amp;#x5F8C;&amp;#x306E;&amp;#x5F0F;&amp;#x306E;&amp;#x5024;&amp;#x304C;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x5834;&amp;#x5408;&amp;#x306F;return&amp;#x30AD;&amp;#x30FC;&amp;#x30EF;&amp;#x30FC;&amp;#x30C9;&amp;#x306F;&amp;#x4E0D;&amp;#x8981;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;&amp;#x4E00;&amp;#x3064;&amp;#x306E;&amp;#x5F0F;&amp;#x3067;&amp;#x7D42;&amp;#x308F;&amp;#x308B;&amp;#x5834;&amp;#x5408;&amp;#x306F;&amp;#x4E2D;&amp;#x62EC;&amp;#x5F27;&amp;#x306F;&amp;#x4E0D;&amp;#x8981;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;&amp;#x3001;&amp;#x5F0F;&amp;#x304B;&amp;#x3089;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x304C;&amp;#x578B;&amp;#x63A8;&amp;#x8AD6;&amp;#x3067;&amp;#x304D;&amp;#x308B;&amp;#x5834;&amp;#x5408;&amp;#x306F;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x306E;&amp;#x578B;&amp;#x3082;&amp;#x7701;&amp;#x7565;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  12. if&amp;#x5F0F;&amp;#x3068;for&amp;#x5F0F;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x6587;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x5F0F;&amp;#x306B;&amp;#x306A;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5F0F;&amp;#x306F;&amp;#x5024;&amp;#x3092;&amp;#x8A55;&amp;#x4FA1;&amp;#x3057;&amp;#x8FD4;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nif&amp;#x5F0F;&amp;#x306F;Java&amp;#x306E;&amp;#x4E09;&amp;#x9805;&amp;#x6F14;&amp;#x7B97;&amp;#x5B50;&amp;#x307F;&amp;#x305F;&amp;#x3044;&amp;#x306A;&amp;#x611F;&amp;#x3058;&amp;#x3002;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;=&amp;#x306B;&amp;#x7D9A;&amp;#x3051;&amp;#x3066;&amp;#x7C21;&amp;#x6F54;&amp;#x306B;&amp;#x8A18;&amp;#x8FF0;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nfor&amp;#x5F0F;&amp;#x306F;Java&amp;#x3068;&amp;#x540C;&amp;#x69D8;&amp;#x7E70;&amp;#x308A;&amp;#x8FD4;&amp;#x3057;&amp;#x51E6;&amp;#x7406;&amp;#x3067;&amp;#x4F7F;&amp;#x3048;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;yield(&amp;#x30A4;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;)&amp;#x3067;&amp;#x8FD4;&amp;#x3057;&amp;#x305F;&amp;#x5024;&amp;#x3092;&amp;#x683C;&amp;#x7D0D;&amp;#x3057;&amp;#x305F;&amp;#x30B3;&amp;#x30EC;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3092;&amp;#x8FD4;&amp;#x3059;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  13. &amp;#x6B21;&amp;#x306F;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x540D;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B;&amp;#x30B3;&amp;#x30F3;&amp;#x30B9;&amp;#x30C8;&amp;#x30E9;&amp;#x30AF;&amp;#x30BF;&amp;#x306E;&amp;#x5F15;&amp;#x6570;&amp;#x30EA;&amp;#x30B9;&amp;#x30C8;&amp;#x3092;&amp;#x66F8;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x305D;&amp;#x3057;&amp;#x3066;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306E;&amp;#x30D6;&amp;#x30ED;&amp;#x30C3;&amp;#x30AF;&amp;#x304C;&amp;#x30B3;&amp;#x30F3;&amp;#x30B9;&amp;#x30C8;&amp;#x30E9;&amp;#x30AF;&amp;#x30BF;&amp;#x30D6;&amp;#x30ED;&amp;#x30C3;&amp;#x30AF;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x3053;&amp;#x306B;&amp;#x5BA3;&amp;#x8A00;&amp;#x3057;&amp;#x305F;&amp;#x5909;&amp;#x6570;&amp;#x304C;&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;firstName&amp;#x3068;lastName&amp;#x304C;public&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  14. \n
  15. Java&amp;#x3068;&amp;#x540C;&amp;#x69D8;&amp;#x306B;new&amp;#x3057;&amp;#x3066;&amp;#x4F7F;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  16. HelloWorld&amp;#x3067;&amp;#x3082;&amp;#x8AAC;&amp;#x660E;&amp;#x3057;&amp;#x305F;object&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;new&amp;#x305B;&amp;#x305A;&amp;#x306B;&amp;#x30B7;&amp;#x30F3;&amp;#x30B0;&amp;#x30EB;&amp;#x30C8;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x4F7F;&amp;#x3048;&amp;#x307E;&amp;#x3059;&amp;#x3002;static&amp;#x306E;&amp;#x4EE3;&amp;#x308F;&amp;#x308A;&amp;#x306B;&amp;#x4F7F;&amp;#x3048;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30B3;&amp;#x30F3;&amp;#x30B9;&amp;#x30C8;&amp;#x30E9;&amp;#x30AF;&amp;#x30BF;&amp;#x306F;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\n
  17. Scala&amp;#x306B;&amp;#x306F;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3068;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x6A5F;&amp;#x80FD;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x540C;&amp;#x3058;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x304B;&amp;#x540C;&amp;#x3058;&amp;#x30D1;&amp;#x30C3;&amp;#x30B1;&amp;#x30FC;&amp;#x30B8;&amp;#x306B;&amp;#x3042;&amp;#x308B;&amp;#x540C;&amp;#x3058;&amp;#x540D;&amp;#x524D;&amp;#x306E;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3068;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3059;&amp;#x3002;\nJava&amp;#x3060;&amp;#x3068;&amp;#x540D;&amp;#x524D;&amp;#x7A7A;&amp;#x9593;&amp;#x3067;&amp;#x885D;&amp;#x7A81;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;Scala&amp;#x3067;&amp;#x306F;&amp;#x3057;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\n&amp;#x3053;&amp;#x306E;&amp;#x304A;&amp;#x91D1;&amp;#x306E;Money&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x5BFE;&amp;#x3057;&amp;#x3066;&amp;#x3001;Money&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x3001;JPY&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x5B9A;&amp;#x6570;&amp;#x3084;&amp;#x3001;apply&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3092;&amp;#x63D0;&amp;#x4F9B;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;Money.JPY&amp;#x306F;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x5074;&amp;#x306B;&amp;#x306F;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306B;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;&amp;#x3001;apply&amp;#x306F;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;\nappy&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;&amp;#x7CD6;&amp;#x8863;&amp;#x69CB;&amp;#x6587;&amp;#x306B;&amp;#x3088;&amp;#x3063;&amp;#x3066;&amp;#x7701;&amp;#x7565;&amp;#x3057;&amp;#x3066;&amp;#x8A18;&amp;#x8FF0;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;new&amp;#x3059;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x304C;&amp;#x306A;&amp;#x304F;&amp;#x306A;&amp;#x308A;&amp;#x3001;&amp;#x8A18;&amp;#x8FF0;&amp;#x6027;&amp;#x304C;&amp;#x9AD8;&amp;#x307E;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  18. Scala&amp;#x3067;&amp;#x306F;match&amp;#x5F0F;&amp;#x3092;&amp;#x4F7F;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x69D8;&amp;#x3005;&amp;#x306A;&amp;#x3082;&amp;#x306E;&amp;#x3092;&amp;#x30D1;&amp;#x30BF;&amp;#x30FC;&amp;#x30F3;&amp;#x30DE;&amp;#x30C3;&amp;#x30C1;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;Java&amp;#x306E;swtich&amp;#x6587;&amp;#x306B;&amp;#x4F3C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x305D;&amp;#x308C;&amp;#x3092;&amp;#x8D85;&amp;#x8D8A;&amp;#x3057;&amp;#x305F;&amp;#x5F0F;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x3053;&amp;#x308C;&amp;#x306F;switch&amp;#x6587;&amp;#x3067;&amp;#x304A;&amp;#x99B4;&amp;#x67D3;&amp;#x307F;&amp;#x306E;&amp;#x6570;&amp;#x5024;&amp;#x306E;&amp;#x30DE;&amp;#x30C3;&amp;#x30C1;&amp;#x30F3;&amp;#x30B0;&amp;#x3067;&amp;#x3059;&amp;#x3002;n&amp;#x3092;&amp;#x30BB;&amp;#x30EC;&amp;#x30AF;&amp;#x30BF;&amp;#x30FC;&amp;#x3068;&amp;#x3044;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;match&amp;#x5F0F;&amp;#x306E;&amp;#x4E2D;&amp;#x306E;case&amp;#x305D;&amp;#x308C;&amp;#x305E;&amp;#x308C;&amp;#x304C;&amp;#x6761;&amp;#x4EF6;&amp;#x3067;&amp;#x3059;&amp;#x3002;=&gt;&amp;#x4EE5;&amp;#x964D;&amp;#x306B;&amp;#x5F0F;&amp;#x3092;&amp;#x66F8;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x5F0F;&amp;#x306F;&amp;#x8A55;&amp;#x4FA1;&amp;#x3055;&amp;#x308C;&amp;#x3066;match&amp;#x5F0F;&amp;#x306E;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  19. &amp;#x6570;&amp;#x5024;&amp;#x4EE5;&amp;#x5916;&amp;#x306B;&amp;#x3082;&amp;#x6587;&amp;#x5B57;&amp;#x5217;&amp;#x3084;&amp;#x3001;&amp;#x578B;&amp;#x3001;&amp;#x30B3;&amp;#x30EC;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3001;&amp;#x6B63;&amp;#x898F;&amp;#x8868;&amp;#x73FE;&amp;#x306B;&amp;#x3082;&amp;#x30DE;&amp;#x30C3;&amp;#x30C1;&amp;#x3055;&amp;#x305B;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x304B;&amp;#x306A;&amp;#x308A;&amp;#x5F37;&amp;#x529B;&amp;#x306A;&amp;#x306E;&amp;#x3067;&amp;#x3001;Scala&amp;#x3067;&amp;#x306F;if&amp;#x5F0F;&amp;#x306F;&amp;#x307B;&amp;#x3068;&amp;#x3093;&amp;#x3069;&amp;#x4F7F;&amp;#x3044;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\n
  20. &amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x7D10;&amp;#x3065;&amp;#x304F;&amp;#x3082;&amp;#x306E;&amp;#x3067;&amp;#x3059;&amp;#x3001;&amp;#x95A2;&amp;#x6570;&amp;#x306F;&amp;#x72EC;&amp;#x7ACB;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#xFF11;&amp;#x3064;&amp;#x4EE5;&amp;#x4E0A;&amp;#x306E;&amp;#x5F15;&amp;#x6570;&amp;#x3092;&amp;#x3068;&amp;#x308A;&amp;#xFF11;&amp;#x3064;&amp;#x306E;&amp;#x7D50;&amp;#x679C;&amp;#x3092;&amp;#x751F;&amp;#x6210;&amp;#x3059;&amp;#x308B;&amp;#x30DE;&amp;#x30C3;&amp;#x30D4;&amp;#x30F3;&amp;#x30B0;&amp;#x306A;&amp;#x3069;&amp;#x3068;&amp;#x4F8B;&amp;#x3048;&amp;#x3089;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nScala&amp;#x3067;&amp;#x306F;&amp;#x95A2;&amp;#x6570;&amp;#x30EA;&amp;#x30C6;&amp;#x30E9;&amp;#x30EB;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x8A18;&amp;#x8FF0;&amp;#x65B9;&amp;#x6CD5;&amp;#x3067;&amp;#x95A2;&amp;#x6570;&amp;#x3092;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;a&amp;#x3092;&amp;#x4E8C;&amp;#x4E57;&amp;#x3059;&amp;#x308B;&amp;#x95A2;&amp;#x6570;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x540D;&amp;#x524D;&amp;#x304C;&amp;#x306A;&amp;#x3044;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x7121;&amp;#x540D;&amp;#x95A2;&amp;#x6570;&amp;#x3068;&amp;#x3082;&amp;#x547C;&amp;#x3070;&amp;#x308C;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3053;&amp;#x306E;&amp;#x7121;&amp;#x540D;&amp;#x95A2;&amp;#x6570;&amp;#x3092;&amp;#x5909;&amp;#x6570;&amp;#x306B;&amp;#x4EE3;&amp;#x5165;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x4ED6;&amp;#x306E;&amp;#x95A2;&amp;#x6570;&amp;#x3084;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x3084;&amp;#x5F15;&amp;#x6570;&amp;#x306B;&amp;#x53D6;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x95A2;&amp;#x6570;&amp;#x578B;&amp;#x8A00;&amp;#x8A9E;&amp;#x3067;&amp;#x306F;&amp;#x3001;&amp;#x95A2;&amp;#x6570;&amp;#x5358;&amp;#x4F53;&amp;#x3092;&amp;#x5236;&amp;#x9650;&amp;#x306A;&amp;#x304F;&amp;#x5229;&amp;#x7528;&amp;#x53EF;&amp;#x80FD;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x4E00;&amp;#x4EBA;&amp;#x524D;&amp;#x306E;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3068;&amp;#x3044;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nsquare&amp;#x306F;&amp;#x95A2;&amp;#x6570;&amp;#x540D;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x3001;&amp;#x7121;&amp;#x540D;&amp;#x95A2;&amp;#x6570;&amp;#x3078;&amp;#x306E;&amp;#x53C2;&amp;#x7167;&amp;#x306E;&amp;#x540D;&amp;#x524D;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x95A2;&amp;#x6570;&amp;#x306E;&amp;#x578B;&amp;#x306F;&amp;#x578B;&amp;#x63A8;&amp;#x8AD6;&amp;#x3067;&amp;#x7701;&amp;#x7565;&amp;#x53EF;&amp;#x80FD;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x547C;&amp;#x3073;&amp;#x51FA;&amp;#x3057;&amp;#x3082;&amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n\n\n
  21. &amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x7D10;&amp;#x3065;&amp;#x304F;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3092;&amp;#x95A2;&amp;#x6570;&amp;#x306B;&amp;#x5909;&amp;#x63DB;&amp;#x3059;&amp;#x308B;&amp;#x306E;&amp;#x306F;&amp;#x7C21;&amp;#x5358;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x540D;&amp;#x306E;&amp;#x5F8C;&amp;#x308D;&amp;#x306B; _&amp;#x3092;&amp;#x4ED8;&amp;#x3051;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3082;&amp;#x3057;&amp;#x304F;&amp;#x306F;&amp;#x95A2;&amp;#x6570;&amp;#x306E;&amp;#x578B;&amp;#x30A2;&amp;#x30CE;&amp;#x30C6;&amp;#x30FC;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3092;&amp;#x6307;&amp;#x5B9A;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3088;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  22. &amp;#x30B3;&amp;#x30EC;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x306F;&amp;#x4E0D;&amp;#x5909;&amp;#x3068;&amp;#x53EF;&amp;#x5909;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  23. &amp;#x6B21;&amp;#x306F;&amp;#x8981;&amp;#x7D20;&amp;#x306E;&amp;#x7E70;&amp;#x308A;&amp;#x8FD4;&amp;#x3057;&amp;#x51E6;&amp;#x7406;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n(1)foreach&amp;#x306F;&amp;#x95A2;&amp;#x6570;&amp;#x3092;&amp;#x5F15;&amp;#x6570;&amp;#x306B;&amp;#x53D6;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5F15;&amp;#x6570;&amp;#x304C;&amp;#x8981;&amp;#x7D20;&amp;#x578B;&amp;#x3067;&amp;#x623B;&amp;#x308A;&amp;#x5024;&amp;#x306F;Unit&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x8981;&amp;#x7D20;&amp;#x6BCE;&amp;#x306B;&amp;#x305D;&amp;#x306E;&amp;#x95A2;&amp;#x6570;&amp;#x3092;&amp;#x547C;&amp;#x3073;&amp;#x51FA;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;(2)&amp;#x5F15;&amp;#x6570;&amp;#x306E;&amp;#x578B;&amp;#x6307;&amp;#x5B9A;&amp;#x3068;&amp;#x62EC;&amp;#x5F27;&amp;#x306F;&amp;#x7701;&amp;#x7565;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;(3)&amp;#x5F15;&amp;#x6570;&amp;#x3092;&amp;#x30D7;&amp;#x30EC;&amp;#x30FC;&amp;#x30B9;&amp;#x30DB;&amp;#x30EB;&amp;#x30C0;&amp;#x306B;&amp;#x7F6E;&amp;#x304D;&amp;#x63DB;&amp;#x3048;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;(4)&amp;#x30D7;&amp;#x30EC;&amp;#x30FC;&amp;#x30B9;&amp;#x30DB;&amp;#x30EB;&amp;#x30C0;&amp;#x304C;&amp;#x4E00;&amp;#x5EA6;&amp;#x3057;&amp;#x304B;&amp;#x51FA;&amp;#x3066;&amp;#x3053;&amp;#x306A;&amp;#x3044;&amp;#x5834;&amp;#x5408;&amp;#x306F;&amp;#x5F15;&amp;#x6570;=&gt;&amp;#x3092;&amp;#x7701;&amp;#x7565;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;(5)println&amp;#x6587;&amp;#x306E;&amp;#x5F15;&amp;#x6570;&amp;#x304C;&amp;#xFF11;&amp;#x3064;&amp;#x3067;&amp;#x3042;&amp;#x308B;&amp;#x5834;&amp;#x5408;&amp;#x306F;&amp;#x30D7;&amp;#x30EC;&amp;#x30FC;&amp;#x30B9;&amp;#x30DB;&amp;#x30EB;&amp;#x30C0;&amp;#x81EA;&amp;#x4F53;&amp;#x3092;&amp;#x7701;&amp;#x7565;&amp;#x53EF;&amp;#x80FD;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x3061;&amp;#x306A;&amp;#x307F;&amp;#x306B;&amp;#x3001;map&amp;#x3082;&amp;#x7E70;&amp;#x308A;&amp;#x8FD4;&amp;#x3057;&amp;#x64CD;&amp;#x4F5C;&amp;#x304C;&amp;#x53EF;&amp;#x80FD;&amp;#x3067;&amp;#x3059;&amp;#x3002;Java&amp;#x306E;Map.Entry&amp;#x306B;&amp;#x76F8;&amp;#x5F53;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;_1&amp;#x304C;&amp;#x30AD;&amp;#x30FC;&amp;#x3067;&amp;#x3001;_2&amp;#x304C;&amp;#x5024;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x8907;&amp;#x6570;&amp;#x306E;&amp;#x5024;&amp;#x3092;&amp;#x3072;&amp;#x3068;&amp;#x307E;&amp;#x3068;&amp;#x3081;&amp;#x306B;&amp;#x3059;&amp;#x308B;&amp;#x30BF;&amp;#x30D7;&amp;#x30EB;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x3082;&amp;#x306E;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;Map&amp;#x306F;&amp;#x30BF;&amp;#x30D7;&amp;#x30EB;&amp;#x306E;Iterable&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x306E;&amp;#x3067;List&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x6271;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  24. &amp;#x4ED6;&amp;#x306B;&amp;#x3082;&amp;#x4FBF;&amp;#x5229;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x7279;&amp;#x5B9A;&amp;#x306E;&amp;#x6761;&amp;#x4EF6;&amp;#x306E;&amp;#x8981;&amp;#x7D20;&amp;#x3060;&amp;#x3051;&amp;#x3092;&amp;#x53D6;&amp;#x5F97;&amp;#x3059;&amp;#x308B;&amp;#x30D5;&amp;#x30A3;&amp;#x30EB;&amp;#x30BF;&amp;#x30FC;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3084;&amp;#x3001;&amp;#x7570;&amp;#x306A;&amp;#x308B;&amp;#x30B3;&amp;#x30EC;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3078;&amp;#x306E;&amp;#x5909;&amp;#x63DB;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x308B;map&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x3061;&amp;#x306A;&amp;#x307F;&amp;#x306B;Range&amp;#x3067;&amp;#x6570;&amp;#x5217;&amp;#x3092;&amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x3064;&amp;#x304F;&amp;#x308C;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;Range&amp;#x3068;map&amp;#x3068;&amp;#x30D1;&amp;#x30BF;&amp;#x30FC;&amp;#x30F3;&amp;#x30DE;&amp;#x30C3;&amp;#x30C1;&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x3066;FizzBuzz&amp;#x304C;6&amp;#x884C;&amp;#x3067;&amp;#x66F8;&amp;#x3051;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  25. \n
  26. &amp;#x6B21;&amp;#x306F;trait&amp;#x3067;&amp;#x3059;&amp;#x3002;trait&amp;#x306F;&amp;#x5B9F;&amp;#x88C5;&amp;#x30B3;&amp;#x30FC;&amp;#x30C9;&amp;#x3082;&amp;#x66F8;&amp;#x3051;&amp;#x308B;&amp;#x30A4;&amp;#x30F3;&amp;#x30BF;&amp;#x30FC;&amp;#x30D5;&amp;#x30A7;&amp;#x30A4;&amp;#x30B9;&amp;#x3060;&amp;#x3068;&amp;#x601D;&amp;#x3063;&amp;#x3066;&amp;#x3082;&amp;#x3089;&amp;#x3063;&amp;#x3066;OK&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x66F8;&amp;#x304F;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x5B9F;&amp;#x88C5;&amp;#x30B3;&amp;#x30FC;&amp;#x30C9;&amp;#x306E;&amp;#x65AD;&amp;#x7247;&amp;#x3092;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3057;&amp;#x3066;&amp;#x3001;&amp;#x4ED6;&amp;#x306E;trait&amp;#x3084;class&amp;#x306B;mix-in&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  27. \n
  28. \n
  29. &amp;#x305D;&amp;#x308C;&amp;#x305E;&amp;#x308C;&amp;#x306E;&amp;#x30C9;&amp;#x30E1;&amp;#x30A4;&amp;#x30F3;&amp;#x30E2;&amp;#x30C7;&amp;#x30EB;&amp;#x3092;&amp;#x8AAC;&amp;#x660E;&amp;#x3059;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x306B;&amp;#x62BD;&amp;#x8C61;&amp;#x7684;&amp;#x306A;&amp;#x578B;&amp;#x3092;trait&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x3066;&amp;#x8AAC;&amp;#x660E;&amp;#x3057;&amp;#x305F;&amp;#x3044;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x307E;&amp;#x305A;&amp;#x6700;&amp;#x521D;&amp;#x306F; DDD&amp;#x306E;&amp;#x30E2;&amp;#x30C7;&amp;#x30EB;&amp;#x99C6;&amp;#x52D5;&amp;#x958B;&amp;#x767A;&amp;#x306E;&amp;#x8A71;&amp;#x306E;&amp;#x6700;&amp;#x521D;&amp;#x306B;&amp;#x51FA;&amp;#x3066;&amp;#x304F;&amp;#x308B;&amp;#x306E;&amp;#x304C;&amp;#x3001;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3092;&amp;#x8868;&amp;#x3059;trait&amp;#x3067;&amp;#x3059;&amp;#x3002;\ntrait&amp;#x306F;&amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x8A00;&amp;#x3048;&amp;#x3070;&amp;#x5B9F;&amp;#x88C5;&amp;#x3082;&amp;#x66F8;&amp;#x3051;&amp;#x308B;&amp;#x30A4;&amp;#x30F3;&amp;#x30BF;&amp;#x30FC;&amp;#x30D5;&amp;#x30A7;&amp;#x30A4;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;equals&amp;#x3068;hashCode&amp;#x306E;&amp;#x5B9F;&amp;#x88C5;&amp;#x304C;&amp;#x8A18;&amp;#x8FF0;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;id&amp;#x3082;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;id&amp;#x306F;&amp;#x62BD;&amp;#x8C61;&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x3068;&amp;#x3044;&amp;#x3063;&amp;#x3066;&amp;#x5B9F;&amp;#x88C5;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3067;&amp;#x5B9A;&amp;#x7FA9;&amp;#x304C;&amp;#x5FC5;&amp;#x8981;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306F;&amp;#x3001;&amp;#x30B7;&amp;#x30B9;&amp;#x30C6;&amp;#x30E0;&amp;#x4E0A;&amp;#x3067;&amp;#x8B58;&amp;#x5225;&amp;#x3092;&amp;#x76EE;&amp;#x7684;&amp;#x3068;&amp;#x3059;&amp;#x308B;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x8B58;&amp;#x5225;&amp;#x3068;&amp;#x306F;&amp;#x300C;&amp;#x7269;&amp;#x4E8B;&amp;#x306E;&amp;#x7A2E;&amp;#x985E;&amp;#x3084;&amp;#x6027;&amp;#x8CEA;&amp;#x306A;&amp;#x3069;&amp;#x3092;&amp;#x898B;&amp;#x5206;&amp;#x3051;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x300D;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x8A00;&amp;#x3044;&amp;#x63DB;&amp;#x3048;&amp;#x308B;&amp;#x3068;&amp;#x3001;&amp;#x898B;&amp;#x5206;&amp;#x3051;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x5FC5;&amp;#x8981;&amp;#x306A;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x304C;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306E;&amp;#x540C;&amp;#x4E00;&amp;#x6027;&amp;#x306F;&amp;#x3001;&amp;#x5C5E;&amp;#x6027;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x8B58;&amp;#x5225;&amp;#x5B50;&amp;#x304C;&amp;#x540C;&amp;#x4E00;&amp;#x304B;&amp;#x306B;&amp;#x3088;&amp;#x3063;&amp;#x3066;&amp;#x5224;&amp;#x5B9A;&amp;#x3055;&amp;#x308C;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x3001;equals&amp;#x3067;&amp;#x306F;match&amp;#x5F0F;&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x3066;id&amp;#x3092;&amp;#x5224;&amp;#x5B9A;&amp;#x3059;&amp;#x308B;&amp;#x5B9F;&amp;#x88C5;&amp;#x306B;&amp;#x306A;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3053;&amp;#x308C;&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x7D99;&amp;#x627F;(Mix-in)&amp;#x3059;&amp;#x308C;&amp;#x3070;&amp;#x3088;&amp;#x3044;&amp;#x308F;&amp;#x3051;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  30. &amp;#x5148;&amp;#x307B;&amp;#x3069;&amp;#x306E;Entity&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3057;&amp;#x305F;Employee&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;Entity&amp;#x306E;&amp;#x30C8;&amp;#x30EC;&amp;#x30A4;&amp;#x30C8;&amp;#x306E;id&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x304C;&amp;#x3042;&amp;#x3063;&amp;#x305F;&amp;#x306E;&amp;#x3067;&amp;#x3001;Employee&amp;#x3067;&amp;#x3082;id&amp;#x5C5E;&amp;#x6027;&amp;#x304C;&amp;#x5FC5;&amp;#x8981;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306E;&amp;#x6982;&amp;#x5FF5;&amp;#x7684;&amp;#x306A;&amp;#x540C;&amp;#x4E00;&amp;#x6027;&amp;#x306F;&amp;#x3001;id&amp;#x306E;&amp;#x307F;&amp;#x306B;&amp;#x3088;&amp;#x3063;&amp;#x3066;&amp;#x884C;&amp;#x308F;&amp;#x308C;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306E;&amp;#x5C5E;&amp;#x6027;&amp;#x306F;&amp;#x5909;&amp;#x5316;&amp;#x3057;&amp;#x3066;&amp;#x3082;&amp;#x3001;&amp;#x8B58;&amp;#x5225;&amp;#x5B50;&amp;#x304C;&amp;#x5909;&amp;#x308F;&amp;#x3089;&amp;#x306A;&amp;#x3051;&amp;#x308C;&amp;#x3070;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3092;&amp;#x898B;&amp;#x5206;&amp;#x3051;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5F93;&amp;#x696D;&amp;#x54E1;&amp;#x306E;&amp;#x8B58;&amp;#x5225;&amp;#x3092;&amp;#x5C5E;&amp;#x6027;&amp;#x3067;&amp;#x884C;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x3068;&amp;#x3001;&amp;#x8EAB;&amp;#x9577;&amp;#x3084;&amp;#x4F53;&amp;#x91CD;&amp;#x3084;&amp;#x540D;&amp;#x524D;&amp;#x306A;&amp;#x3069;&amp;#x304C;&amp;#x5909;&amp;#x308F;&amp;#x3063;&amp;#x305F;&amp;#x5834;&amp;#x5408;&amp;#x306B;&amp;#x8B58;&amp;#x5225;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x304F;&amp;#x306A;&amp;#x3063;&amp;#x3066;&amp;#x3057;&amp;#x307E;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x3046;&amp;#x3044;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x3092;&amp;#x56DE;&amp;#x907F;&amp;#x3059;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x306B;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3092;&amp;#x4F7F;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n\n\n
  31. &amp;#x540C;&amp;#x6642;&amp;#x306B;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x3082;&amp;#x8AAC;&amp;#x660E;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x8907;&amp;#x96D1;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x304C;&amp;#x3061;&amp;#x306A;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x751F;&amp;#x6210;&amp;#x51E6;&amp;#x7406;&amp;#x3092;&amp;#x62C5;&amp;#x3046;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x4F8B;&amp;#x3048;&amp;#x3070;&amp;#x3001;&amp;#x8ECA;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x8ECA;&amp;#x81EA;&amp;#x8EAB;&amp;#x3092;&amp;#x4F5C;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x306F;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x3084;&amp;#x306F;&amp;#x308A;&amp;#x3001;&amp;#x81EA;&amp;#x52D5;&amp;#x8ECA;&amp;#x5DE5;&amp;#x5834;&amp;#x304C;&amp;#x8ECA;&amp;#x3092;&amp;#x751F;&amp;#x7523;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x306E;&amp;#x304C;&amp;#x81EA;&amp;#x7136;&amp;#x3060;&amp;#x3057;&amp;#x3001;&amp;#x8ECA;&amp;#x306E;&amp;#x8CFC;&amp;#x5165;&amp;#x8005;&amp;#x306F;&amp;#x5DE5;&amp;#x5834;&amp;#x5185;&amp;#x306E;&amp;#x8907;&amp;#x96D1;&amp;#x306A;&amp;#x751F;&amp;#x7523;&amp;#x5DE5;&amp;#x7A0B;&amp;#x3092;&amp;#x6C17;&amp;#x306B;&amp;#x3059;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x306F;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x672C;&amp;#x6765;&amp;#x306E;&amp;#x5F79;&amp;#x5272;&amp;#x3067;&amp;#x306A;&amp;#x3044;&amp;#x8907;&amp;#x96D1;&amp;#x306A;&amp;#x751F;&amp;#x6210;&amp;#x51E6;&amp;#x7406;&amp;#x3092;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x306B;&amp;#x4EFB;&amp;#x305B;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3001;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3084;&amp;#x30D0;&amp;#x30EA;&amp;#x30E5;&amp;#x30FC;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3092;&amp;#x6271;&amp;#x3044;&amp;#x3084;&amp;#x3059;&amp;#x304F;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nScala&amp;#x306E;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x307E;&amp;#x3055;&amp;#x306B;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x8CAC;&amp;#x52D9;&amp;#x3092;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x304B;&amp;#x3089;&amp;#x5206;&amp;#x96E2;&amp;#x3059;&amp;#x308B;&amp;#x306E;&amp;#x306B;&amp;#x3061;&amp;#x3087;&amp;#x3046;&amp;#x3069;&amp;#x3044;&amp;#x3044;&amp;#x5834;&amp;#x6240;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;apply&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306B;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3057;&amp;#x3066;&amp;#x304F;&amp;#x3060;&amp;#x3055;&amp;#x3044;&amp;#x3002;\n
  32. &amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x3092;&amp;#x547C;&amp;#x3073;&amp;#x51FA;&amp;#x3059;&amp;#x3060;&amp;#x3051;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  33. &amp;#x6B21;&amp;#x306F;&amp;#x3001;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3068;&amp;#x305D;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x59CB;&amp;#x3081;&amp;#x306B;&amp;#x7D39;&amp;#x4ECB;&amp;#x3057;&amp;#x305F;Money&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;Money&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306F;&amp;#x30D0;&amp;#x30EA;&amp;#x30E5;&amp;#x30FC;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3002;&amp;#x3064;&amp;#x307E;&amp;#x308A;&amp;#x5024;&amp;#x3092;&amp;#x8868;&amp;#x3059;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x6982;&amp;#x5FF5;&amp;#x7684;&amp;#x306A;&amp;#x540C;&amp;#x4E00;&amp;#x6027;&amp;#x3092;&amp;#x6301;&amp;#x3061;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x7269;&amp;#x4E8B;&amp;#x3092;&amp;#x8868;&amp;#x3059;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x4F8B;&amp;#x3048;&amp;#x3070;&amp;#x3001;100&amp;#x5186;&amp;#x304C;&amp;#x305D;&amp;#x308C;&amp;#x305E;&amp;#x308C;&amp;#x306B;&amp;#x3042;&amp;#x3063;&amp;#x3066;&amp;#x3082;&amp;#x3001;100&amp;#x5186;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x4FA1;&amp;#x5024;&amp;#x3092;&amp;#x8868;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x308C;&amp;#x3070;&amp;#x3088;&amp;#x3044;&amp;#x306E;&amp;#x3067;&amp;#x3042;&amp;#x3063;&amp;#x3066;&amp;#x3001;&amp;#x500B;&amp;#x3005;&amp;#x306E;100&amp;#x5186;&amp;#x306E;&amp;#x8B58;&amp;#x5225;&amp;#x306B;&amp;#x95A2;&amp;#x5FC3;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x308F;&amp;#x3051;&amp;#x3067;&amp;#x306F;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x4F55;&amp;#x3067;&amp;#x3042;&amp;#x308B;&amp;#x304B;&amp;#x3060;&amp;#x3051;&amp;#x304C;&amp;#x554F;&amp;#x984C;&amp;#x3067;&amp;#x3001;&amp;#x8AB0;&amp;#x3068;&amp;#x304B;&amp;#x3001;&amp;#x3069;&amp;#x308C;&amp;#x3067;&amp;#x3042;&amp;#x308B;&amp;#x304B;&amp;#x306F;&amp;#x554F;&amp;#x308F;&amp;#x308C;&amp;#x306A;&amp;#x3044;&amp;#x8A2D;&amp;#x8A08;&amp;#x306E;&amp;#x8981;&amp;#x7D20;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x69D8;&amp;#x3005;&amp;#x306A;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x5171;&amp;#x6709;&amp;#x3055;&amp;#x308C;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x3001;&amp;#x4E0D;&amp;#x5909;&amp;#x3067;&amp;#x3042;&amp;#x308B;&amp;#x5FC5;&amp;#x8981;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x305F;&amp;#x3081;&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x306F;val&amp;#x3067;&amp;#x5BA3;&amp;#x8A00;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5171;&amp;#x6709;&amp;#x3059;&amp;#x308B;&amp;#x306A;&amp;#x3089;&amp;#x4E0D;&amp;#x5909;&amp;#x3002;&amp;#x6027;&amp;#x80FD;&amp;#x9762;&amp;#x3092;&amp;#x8003;&amp;#x616E;&amp;#x3057;&amp;#x3066;&amp;#x53EF;&amp;#x5909;&amp;#x3068;&amp;#x3059;&amp;#x308B;&amp;#x5834;&amp;#x5408;&amp;#x3082;&amp;#x3042;&amp;#x308B;&amp;#x304C;&amp;#x3001;&amp;#x539F;&amp;#x5247;&amp;#x7684;&amp;#x306B;&amp;#x4E0D;&amp;#x5909;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x307E;&amp;#x305F;&amp;#x3001;equals&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x306F;&amp;#x3001;&amp;#x4E00;&amp;#x822C;&amp;#x7684;&amp;#x306B;ID&amp;#x3088;&amp;#x308A;&amp;#x7B49;&amp;#x4FA1;&amp;#x5224;&amp;#x5B9A;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x3001;&amp;#x5C5E;&amp;#x6027;&amp;#x304C;&amp;#x540C;&amp;#x3058;&amp;#x304B;&amp;#x3069;&amp;#x3046;&amp;#x304B;&amp;#x306E;&amp;#x5224;&amp;#x5B9A;&amp;#x3092;&amp;#x884C;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3068;&amp;#x540C;&amp;#x69D8;&amp;#x306B;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x306F;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x5B9F;&amp;#x88C5;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;unapply&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;&amp;#x62BD;&amp;#x51FA;&amp;#x5B50;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x3053;&amp;#x308C;&amp;#x306F;&amp;#x5F8C;&amp;#x3067;&amp;#x8AAC;&amp;#x660E;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n\n
  34. &amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x7B49;&amp;#x4FA1;&amp;#x5224;&amp;#x5B9A;&amp;#x306E;&amp;#x4F8B;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x3053;&amp;#x308C;&amp;#x306F;DDD&amp;#x306B;&amp;#x9650;&amp;#x3089;&amp;#x305A;&amp;#x4E00;&amp;#x822C;&amp;#x5951;&amp;#x7D04;&amp;#x306B;&amp;#x57FA;&amp;#x3065;&amp;#x304D;&amp;#x5B9F;&amp;#x88C5;&amp;#x3055;&amp;#x308C;&amp;#x307E;&amp;#x3059;&amp;#x3002;\nunapply&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x62BD;&amp;#x51FA;&amp;#x5B50;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;&amp;#x3001;apply&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306E;&amp;#x9006;&amp;#x306E;&amp;#x3053;&amp;#x3068;&amp;#x3092;&amp;#x884C;&amp;#x3046;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3001;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x30D5;&amp;#x30A3;&amp;#x30FC;&amp;#x30EB;&amp;#x30C9;&amp;#x3092;&amp;#x62BD;&amp;#x51FA;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x69CB;&amp;#x9020;&amp;#x306B;&amp;#x4F9D;&amp;#x5B58;&amp;#x305B;&amp;#x305A;&amp;#x306B;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306E;&amp;#x60C5;&amp;#x5831;&amp;#x306B;&amp;#x30A2;&amp;#x30AF;&amp;#x30BB;&amp;#x30B9;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x307E;&amp;#x305F;&amp;#x3001;match&amp;#x5F0F;&amp;#x3068;&amp;#x7D44;&amp;#x307F;&amp;#x5408;&amp;#x308F;&amp;#x305B;&amp;#x308B;&amp;#x3068;&amp;#x30D1;&amp;#x30BF;&amp;#x30FC;&amp;#x30F3;&amp;#x30DE;&amp;#x30C3;&amp;#x30C1;&amp;#x306B;&amp;#x5229;&amp;#x7528;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306B;&amp;#x3082;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  35. Scala&amp;#x306B;&amp;#x306F;&amp;#x30D0;&amp;#x30EA;&amp;#x30E5;&amp;#x30FC;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3092;&amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x4F5C;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x306E;&amp;#x6A5F;&amp;#x80FD;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;case class&amp;#x3067;&amp;#x3059;&amp;#x3002;\n&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x5BA3;&amp;#x8A00;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x524D;&amp;#x4F8B;&amp;#x3068;&amp;#x540C;&amp;#x3058;&amp;#x3082;&amp;#x306E;&amp;#x304C;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30A4;&amp;#x30E9;&amp;#x306B;&amp;#x3088;&amp;#x3063;&amp;#x3066;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3055;&amp;#x308C;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x5358;&amp;#x7D14;&amp;#x306A;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306A;&amp;#x3089;&amp;#x3053;&amp;#x308C;&amp;#x3067;&amp;#x5341;&amp;#x5206;&amp;#x3060;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x307E;&amp;#x305F;&amp;#x3001;&amp;#x7279;&amp;#x306B;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306E;&amp;#x578B;&amp;#x3092;&amp;#x30C8;&amp;#x30EC;&amp;#x30A4;&amp;#x30C8;&amp;#x3067;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x304C;&amp;#x3001;&amp;#x5FC5;&amp;#x8981;&amp;#x306A;&amp;#x3089;&amp;#x30DE;&amp;#x30FC;&amp;#x30AB;&amp;#x30FC;&amp;#x30C8;&amp;#x30EC;&amp;#x30A4;&amp;#x30C8;&amp;#x3092;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3088;&amp;#x3044;&amp;#x304B;&amp;#x3082;&amp;#x3057;&amp;#x308C;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;\n\n
  36. &amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x4E0D;&amp;#x5909;&amp;#x306A;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x5B8C;&amp;#x5168;&amp;#x306B;&amp;#x30A4;&amp;#x30F3;&amp;#x30B9;&amp;#x30BF;&amp;#x30F3;&amp;#x30B9;&amp;#x3092;&amp;#x7F6E;&amp;#x304D;&amp;#x63DB;&amp;#x3048;&amp;#x308B;&amp;#x4EE5;&amp;#x5916;&amp;#x306B;&amp;#x5909;&amp;#x66F4;&amp;#x306E;&amp;#x624B;&amp;#x6BB5;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x552F;&amp;#x4E00;&amp;#x306E;&amp;#x30C7;&amp;#x30E1;&amp;#x30EA;&amp;#x30C3;&amp;#x30C8;&amp;#x3068;&amp;#x3082;&amp;#x547C;&amp;#x3070;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x983B;&amp;#x7E41;&amp;#x306B;&amp;#x66F4;&amp;#x65B0;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x5834;&amp;#x5408;&amp;#x306F;&amp;#x30D3;&amp;#x30EB;&amp;#x30C0;&amp;#x30FC;&amp;#x304C;&amp;#x6B32;&amp;#x3057;&amp;#x304F;&amp;#x306A;&amp;#x308B;&amp;#x304B;&amp;#x3082;&amp;#x3057;&amp;#x308C;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x5B9F;&amp;#x88C5;&amp;#x65B9;&amp;#x6CD5;&amp;#x306F;&amp;#x79C1;&amp;#x306E;&amp;#x30D6;&amp;#x30ED;&amp;#x30B0;&amp;#x306E;&amp;#x65B9;&amp;#x306B;&amp;#x3042;&amp;#x308B;&amp;#x306E;&amp;#x3067;ValueObjectBuilder&amp;#x3067;&amp;#x691C;&amp;#x7D22;&amp;#x3057;&amp;#x3066;&amp;#x307F;&amp;#x3066;&amp;#x304F;&amp;#x3060;&amp;#x3055;&amp;#x3044;&amp;#x3002;\n
  37. &amp;#x6B21;&amp;#x306F;&amp;#x30B5;&amp;#x30FC;&amp;#x30D3;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;\n&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3084;&amp;#x30D0;&amp;#x30EA;&amp;#x30E5;&amp;#x30FC;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x500B;&amp;#x5225;&amp;#x306B;&amp;#x632F;&amp;#x308B;&amp;#x821E;&amp;#x3044;&amp;#x3092;&amp;#x6301;&amp;#x3064;&amp;#x5834;&amp;#x5408;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x3002;\n&amp;#x3057;&amp;#x304B;&amp;#x3057;&amp;#x3001;&amp;#x3059;&amp;#x3079;&amp;#x3066;&amp;#x306E;&amp;#x632F;&amp;#x308B;&amp;#x821E;&amp;#x3044;&amp;#x304C;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3084;&amp;#x30D0;&amp;#x30EA;&amp;#x30E5;&amp;#x30FC;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306B;&amp;#x5C5E;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x306F;&amp;#x9650;&amp;#x3089;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x9006;&amp;#x306B;&amp;#x5C5E;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x4E0D;&amp;#x81EA;&amp;#x7136;&amp;#x306A;&amp;#x632F;&amp;#x308B;&amp;#x821E;&amp;#x3044;&amp;#x3082;&amp;#x3042;&amp;#x308B;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x5834;&amp;#x5408;&amp;#x306B;&amp;#x30B5;&amp;#x30FC;&amp;#x30D3;&amp;#x30B9;&amp;#x3092;&amp;#x4F7F;&amp;#x3046;&amp;#x3002;\n&amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x306F;&amp;#x53E3;&amp;#x5EA7;&amp;#x9593;&amp;#x306E;&amp;#x9001;&amp;#x91D1;&amp;#x3092;&amp;#x8868;&amp;#x3057;&amp;#x305F;&amp;#x30B5;&amp;#x30FC;&amp;#x30D3;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x30B5;&amp;#x30FC;&amp;#x30D3;&amp;#x30B9;&amp;#x3067;&amp;#x306F;&amp;#x539F;&amp;#x5247;&amp;#x7684;&amp;#x306B;&amp;#x72B6;&amp;#x614B;&amp;#x3092;&amp;#x6301;&amp;#x305F;&amp;#x305A;&amp;#x306B;&amp;#x3001;&amp;#x30C9;&amp;#x30E1;&amp;#x30A4;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3092;&amp;#x4F7F;&amp;#x3063;&amp;#x305F;&amp;#x30B9;&amp;#x30AF;&amp;#x30EA;&amp;#x30D7;&amp;#x30C8;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x632F;&amp;#x821E;&amp;#x3046;&amp;#x3002;&amp;#x591A;&amp;#x304F;&amp;#x306E;&amp;#x5834;&amp;#x5408;&amp;#x306F;object&amp;#x3067;&amp;#x5B9F;&amp;#x88C5;&amp;#x3059;&amp;#x308C;&amp;#x3070;&amp;#x3088;&amp;#x3044;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n\n
  38. &amp;#x6B21;&amp;#x306F;&amp;#x30A2;&amp;#x30B0;&amp;#x30EA;&amp;#x30B2;&amp;#x30FC;&amp;#x30C8;&amp;#x3002;&amp;#x30A2;&amp;#x30B0;&amp;#x30EA;&amp;#x30B2;&amp;#x30FC;&amp;#x30C8;&amp;#x306F;&amp;#x96E3;&amp;#x3057;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;\n&amp;#x30EB;&amp;#x30FC;&amp;#x30C8;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306F;&amp;#x3001;&amp;#x4E0D;&amp;#x5909;&amp;#x6761;&amp;#x4EF6;&amp;#x306E;&amp;#x30C1;&amp;#x30A7;&amp;#x30C3;&amp;#x30AF;&amp;#x3092;&amp;#x884C;&amp;#x3044;&amp;#x3001;&amp;#x30B0;&amp;#x30ED;&amp;#x30FC;&amp;#x30D0;&amp;#x30EB;&amp;#x306A;&amp;#x540C;&amp;#x4E00;&amp;#x6027;&amp;#x3092;&amp;#x6301;&amp;#x3064;&amp;#x3002;&amp;#x30ED;&amp;#x30FC;&amp;#x30AB;&amp;#x30EB;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306F;&amp;#x96C6;&amp;#x7D04;&amp;#x5185;&amp;#x3067;&amp;#x306E;&amp;#x540C;&amp;#x4E00;&amp;#x6027;&amp;#x3092;&amp;#x4FDD;&amp;#x8A3C;&amp;#x3002;\n&amp;#x5916;&amp;#x90E8;&amp;#x306E;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x3001;&amp;#x5883;&amp;#x754C;&amp;#x5185;&amp;#x90E8;&amp;#x306E;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x4FDD;&amp;#x6301;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x30ED;&amp;#x30FC;&amp;#x30AB;&amp;#x30EB;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3092;&amp;#x4ED6;&amp;#x306E;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306B;&amp;#x6E21;&amp;#x305B;&amp;#x308B;&amp;#x304C;&amp;#x4E00;&amp;#x6642;&amp;#x7684;&amp;#x306A;&amp;#x53C2;&amp;#x7167;&amp;#x3002;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306F;&amp;#x4E0D;&amp;#x5909;&amp;#x3067;&amp;#x3042;&amp;#x308C;&amp;#x3070;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x6E21;&amp;#x305B;&amp;#x308B;&amp;#x3001;&amp;#x53EF;&amp;#x5909;&amp;#x306A;&amp;#x3089;&amp;#x30B3;&amp;#x30D4;&amp;#x30FC;&amp;#x304C;&amp;#x5FC5;&amp;#x8981;&amp;#x3002;\n&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x306A;&amp;#x3069;&amp;#x304B;&amp;#x3089;&amp;#x306E;&amp;#x5165;&amp;#x51FA;&amp;#x529B;&amp;#x306F;&amp;#x3001;&amp;#x96C6;&amp;#x7D04;&amp;#x30EB;&amp;#x30FC;&amp;#x30C8;&amp;#x306E;&amp;#x5358;&amp;#x4F4D;&amp;#x3068;&amp;#x306A;&amp;#x308B;&amp;#x3002;&amp;#x3064;&amp;#x307E;&amp;#x308A;&amp;#x3001;&amp;#x30C8;&amp;#x30E9;&amp;#x30F3;&amp;#x30B6;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x5883;&amp;#x754C;&amp;#x3002;\n
  39. &amp;#x3059;&amp;#x3079;&amp;#x3066;&amp;#x306E;&amp;#x5909;&amp;#x66F4;&amp;#x306F;Employee&amp;#x3092;&amp;#x901A;&amp;#x3059;&amp;#x5FC5;&amp;#x8981;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x304C;&amp;#x3001;&amp;#x5909;&amp;#x66F4;&amp;#x3067;&amp;#x304D;&amp;#x3066;&amp;#x3057;&amp;#x307E;&amp;#x3046;&amp;#x3002;(1)&amp;#x3067;&amp;#x306F;&amp;#x5916;&amp;#x90E8;&amp;#x306E;Department&amp;#x306E;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x6301;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x3067;&amp;#x3001;(2)&amp;#x3067;&amp;#x306F;&amp;#x5185;&amp;#x90E8;&amp;#x306E;Department&amp;#x306E;&amp;#x53C2;&amp;#x7167;&amp;#x3092;&amp;#x516C;&amp;#x958B;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x3001; &amp;#x4E0D;&amp;#x5909;&amp;#x6761;&amp;#x4EF6;&amp;#x304C;&amp;#x7DAD;&amp;#x6301;&amp;#x3067;&amp;#x304D;&amp;#x3066;&amp;#x3044;&amp;#x306A;&amp;#x3044;&amp;#x3002;\n
  40. &amp;#x305D;&amp;#x3053;&amp;#x3067;&amp;#x4E00;&amp;#x3064;&amp;#x306E;&amp;#x89E3;&amp;#x6C7A;&amp;#x7B56;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306F;&amp;#x3001;Java&amp;#x3067;&amp;#x306F;Cloneable(&amp;#x30AF;&amp;#x30ED;&amp;#x30FC;&amp;#x30CA;&amp;#x30D6;&amp;#x30EB;)&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3057;&amp;#x3066;&amp;#x9632;&amp;#x5FA1;&amp;#x7684;&amp;#x30B3;&amp;#x30D4;&amp;#x30FC;&amp;#x3092;&amp;#x751F;&amp;#x6210;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3001;&amp;#x4E0D;&amp;#x5909;&amp;#x6761;&amp;#x4EF6;&amp;#x3092;&amp;#x7DAD;&amp;#x6301;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x65B9;&amp;#x6CD5;&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;Scala&amp;#x3067;&amp;#x306F;@cloneable&amp;#x3092;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x4FEE;&amp;#x98FE;&amp;#x3059;&amp;#x308C;&amp;#x3070;&amp;#x3001;clone&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3067;&amp;#x304D;&amp;#x308B;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n(1)&amp;#x30B3;&amp;#x30F3;&amp;#x30B9;&amp;#x30C8;&amp;#x30E9;&amp;#x30AF;&amp;#x30BF;&amp;#x304B;&amp;#x3089;&amp;#x5916;&amp;#x90E8;&amp;#x306E;dept&amp;#x3092;&amp;#x53D7;&amp;#x3051;&amp;#x53D6;&amp;#x3063;&amp;#x305F;&amp;#x3089;&amp;#x3001;clone&amp;#x3067;&amp;#x8907;&amp;#x88FD;&amp;#x3092;&amp;#x4F5C;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n(2)&amp;#x5916;&amp;#x90E8;&amp;#x3078;dept&amp;#x3092;&amp;#x8FD4;&amp;#x3059;&amp;#x5834;&amp;#x5408;&amp;#x3082;clone&amp;#x3067;&amp;#x8907;&amp;#x88FD;&amp;#x3092;&amp;#x8FD4;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n(3)&amp;#x5916;&amp;#x90E8;&amp;#x304B;&amp;#x3089;dept&amp;#x3092;&amp;#x53D6;&amp;#x308A;&amp;#x8FBC;&amp;#x3080;&amp;#x5834;&amp;#x5408;&amp;#x3082;clone&amp;#x3067;&amp;#x8907;&amp;#x88FD;&amp;#x3092;&amp;#x4F5C;&amp;#x3063;&amp;#x3066;&amp;#x53D6;&amp;#x308A;&amp;#x8FBC;&amp;#x307F;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x3053;&amp;#x3046;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x3067;Employee&amp;#x304C;&amp;#x96C6;&amp;#x7D04;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x306E;&amp;#x4E0D;&amp;#x5909;&amp;#x6761;&amp;#x4EF6;&amp;#x3092;&amp;#x7DAD;&amp;#x6301;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x307E;&amp;#x305F;&amp;#x3001;Employe&amp;#x81EA;&amp;#x8EAB;&amp;#x3082;&amp;#x53EF;&amp;#x5909;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306A;&amp;#x3069;&amp;#x3067;clone&amp;#x3092;&amp;#x63D0;&amp;#x4F9B;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x5834;&amp;#x5408;&amp;#x306F;dept&amp;#x3092;&amp;#x30C7;&amp;#x30A3;&amp;#x30FC;&amp;#x30D7;&amp;#x30B3;&amp;#x30D4;&amp;#x30FC;&amp;#x3059;&amp;#x308B;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3057;&amp;#x306A;&amp;#x3051;&amp;#x308C;&amp;#x3070;&amp;#x306A;&amp;#x308A;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;(4)\n
  41. &amp;#x578B;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x5229;&amp;#x7528;&amp;#x3057;&amp;#x3084;&amp;#x3059;&amp;#x3044;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3059;&amp;#x308B;&amp;#x306B;&amp;#x306F;&amp;#x3001;&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x30C8;&amp;#x30EC;&amp;#x30A4;&amp;#x30C8;&amp;#x3092;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3059;&amp;#x308B;&amp;#x3068;&amp;#x3088;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x3002;Cloneable&amp;#x3092;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306B;&amp;#x30DF;&amp;#x30C3;&amp;#x30AF;&amp;#x30B9;&amp;#x30A4;&amp;#x30F3;&amp;#x3059;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x306E;&amp;#x30C8;&amp;#x30EC;&amp;#x30A4;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  42. \n
  43. Cloneable&amp;#x4EE5;&amp;#x5916;&amp;#x306B;&amp;#x306F;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x3067;&amp;#x8907;&amp;#x88FD;&amp;#x3092;&amp;#x4F5C;&amp;#x308B;&amp;#x65B9;&amp;#x6CD5;&amp;#x3082;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;&amp;#x3053;&amp;#x3061;&amp;#x3089;&amp;#x306E;&amp;#x307B;&amp;#x3046;&amp;#x304C;&amp;#x69CB;&amp;#x9020;&amp;#x304C;&amp;#x30B7;&amp;#x30F3;&amp;#x30D7;&amp;#x30EB;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x5177;&amp;#x8C61;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x304C;&amp;#x3042;&amp;#x308B;&amp;#x3068;&amp;#x3053;&amp;#x308D;&amp;#x3067;&amp;#x3057;&amp;#x304B;&amp;#x8907;&amp;#x88FD;&amp;#x304C;&amp;#x4F5C;&amp;#x308C;&amp;#x307E;&amp;#x305B;&amp;#x3093;&amp;#x3002;&amp;#x5177;&amp;#x8C61;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x306B;&amp;#x4F9D;&amp;#x5B58;&amp;#x3067;&amp;#x304D;&amp;#x306A;&amp;#x3044;&amp;#x5834;&amp;#x5408;&amp;#x306F;clone&amp;#x306E;&amp;#x65B9;&amp;#x304C;&amp;#x6709;&amp;#x5229;&amp;#x3067;&amp;#x3057;&amp;#x3087;&amp;#x3046;&amp;#x3002;\n
  44. &amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x306F;&amp;#x3001;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x306E;&amp;#x8CAF;&amp;#x8535;&amp;#x5EAB;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x610F;&amp;#x5473;&amp;#x3002;\n&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x306F;&amp;#x751F;&amp;#x6210;&amp;#x3055;&amp;#x308C;&amp;#x305F;&amp;#x5F8C;&amp;#x306B;&amp;#x7834;&amp;#x68C4;&amp;#x3055;&amp;#x308C;&amp;#x308B;&amp;#x307E;&amp;#x3067;&amp;#x306E;&amp;#x9593;&amp;#x3001;&amp;#x30C7;&amp;#x30FC;&amp;#x30BF;&amp;#x30D9;&amp;#x30FC;&amp;#x30B9;&amp;#x3084;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3001;&amp;#x30E1;&amp;#x30E2;&amp;#x30EA;&amp;#x30FC;&amp;#x306A;&amp;#x3069;&amp;#x306B;&amp;#x4E00;&amp;#x6642;&amp;#x7684;&amp;#x306B;&amp;#x6C38;&amp;#x7D9A;&amp;#x5316;&amp;#x3059;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x304C;&amp;#x591A;&amp;#x3044;&amp;#x3002;&amp;#x3057;&amp;#x304B;&amp;#x3057;&amp;#x3001;&amp;#x6C38;&amp;#x7D9A;&amp;#x5316;&amp;#x306F;&amp;#x8907;&amp;#x96D1;&amp;#x306A;&amp;#x3082;&amp;#x306E;&amp;#x3067;&amp;#x3042;&amp;#x308A;&amp;#x3001;&amp;#x30C9;&amp;#x30E1;&amp;#x30A4;&amp;#x30F3;&amp;#x306E;&amp;#x672C;&amp;#x8CEA;&amp;#x3067;&amp;#x3082;&amp;#x306A;&amp;#x3044;&amp;#x3002;&amp;#x305D;&amp;#x306E;&amp;#x6C38;&amp;#x7D9A;&amp;#x5316;&amp;#x3092;&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x304C;&amp;#x62C5;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3001;&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x672C;&amp;#x8CEA;&amp;#x7684;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x3044;&amp;#x8907;&amp;#x96D1;&amp;#x3055;&amp;#x3092;&amp;#x6392;&amp;#x9664;&amp;#x3059;&amp;#x308B;&amp;#x3002;\n&amp;#x3053;&amp;#x3053;&amp;#x3067;&amp;#x306F;&amp;#x307E;&amp;#x305A;&amp;#x30EA;&amp;#x30FC;&amp;#x30C9;&amp;#x30AA;&amp;#x30F3;&amp;#x30EA;&amp;#x30FC;&amp;#x306A;&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x3068;&amp;#x3057;&amp;#x3066;&amp;#x3001;EntityResolver&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x306E;&amp;#x3092;&amp;#x5B9A;&amp;#x7FA9;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x591A;&amp;#x304F;&amp;#x306E;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;Scala&amp;#x306E;Iterable&amp;#x306E;&amp;#x529B;&amp;#x3092;&amp;#x501F;&amp;#x308A;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;resolve&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x306F;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3092;\n
  45. &amp;#x3053;&amp;#x306E;&amp;#x4F8B;&amp;#x306F;&amp;#x30AA;&amp;#x30F3;&amp;#x30E1;&amp;#x30E2;&amp;#x30EA;&amp;#x3067;&amp;#x7BA1;&amp;#x7406;&amp;#x3059;&amp;#x308B;&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001; resolve&amp;#x3068;iterator&amp;#x3092;&amp;#x5B9F;&amp;#x88C5;&amp;#x3059;&amp;#x308B;&amp;#x3060;&amp;#x3051;&amp;#x3067;&amp;#x5B8C;&amp;#x6210;&amp;#x3067;&amp;#x3059;&amp;#x3002;Iterable&amp;#x3067;&amp;#x30B3;&amp;#x30EC;&amp;#x30AF;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3067;&amp;#x4F7F;&amp;#x3048;&amp;#x308B;&amp;#x69D8;&amp;#x3005;&amp;#x306A;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x304C;&amp;#x5229;&amp;#x7528;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;&amp;#x3002;foreach&amp;#x3084;exists&amp;#x3084;map&amp;#x306A;&amp;#x3069;&amp;#x304C;&amp;#x4F7F;&amp;#x3048;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  46. &amp;#x6B21;&amp;#x306F;&amp;#x66F8;&amp;#x8FBC;&amp;#x307F;&amp;#x304C;&amp;#x3067;&amp;#x304D;&amp;#x308B;&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x3067;&amp;#x3059;&amp;#x3002;store&amp;#x3068;&amp;#x304B;delete&amp;#x304C;&amp;#x3042;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  47. \n
  48. \n
  49. \n
  50. &amp;#x3064;&amp;#x307E;&amp;#x308A;&amp;#x3001;JavaBeans&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;&amp;#x305D;&amp;#x308C;&amp;#x3092;&amp;#x751F;&amp;#x6210;&amp;#x3059;&amp;#x308B;&amp;#x30C4;&amp;#x30FC;&amp;#x30EB;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  51. &amp;#x5168;&amp;#x90E8;&amp;#x3092;&amp;#x5410;&amp;#x304D;&amp;#x51FA;&amp;#x3059;&amp;#x306E;&amp;#x306F;&amp;#x9AA8;&amp;#x304C;&amp;#x6298;&amp;#x308C;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x3001;Freemarker&amp;#x3092;&amp;#x4F7F;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  52. &amp;#x64CD;&amp;#x4F5C;&amp;#x65B9;&amp;#x6CD5;&amp;#x306F;&amp;#x3053;&amp;#x3093;&amp;#x306A;&amp;#x611F;&amp;#x3058;&amp;#x3002;\n
  53. \n
  54. ClassMeta&amp;#x306B;&amp;#x306F;ID&amp;#x4EE5;&amp;#x5916;&amp;#x306B;&amp;#x3001;&amp;#x30AF;&amp;#x30E9;&amp;#x30B9;&amp;#x540D;&amp;#x3084;&amp;#x30D1;&amp;#x30C3;&amp;#x30B1;&amp;#x30FC;&amp;#x30B8;&amp;#x540D;&amp;#x3001;FieldMeta&amp;#x306E;&amp;#x30EA;&amp;#x30B9;&amp;#x30C8;&amp;#x306A;&amp;#x3069;&amp;#x304C;&amp;#x4FDD;&amp;#x6301;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x30A8;&amp;#x30F3;&amp;#x30C6;&amp;#x30A3;&amp;#x30C6;&amp;#x30A3;&amp;#x3067;&amp;#x3059;&amp;#x3002;@BeanProperty&amp;#x3084;&amp;#x4ED6;&amp;#x306E;getter&amp;#x306F;JavaBeans&amp;#x3092;&amp;#x524D;&amp;#x63D0;&amp;#x306B;&amp;#x3059;&amp;#x308B;Freemarker&amp;#x306E;&amp;#x305F;&amp;#x3081;&amp;#x306E;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x3061;&amp;#x306A;&amp;#x307F;&amp;#x306B;ID&amp;#x306F;String&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x304F;&amp;#x3001;Identifier&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3092;&amp;#x5229;&amp;#x7528;&amp;#x3057;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  55. ClassMeta&amp;#x306E;&amp;#x30B3;&amp;#x30F3;&amp;#x30D1;&amp;#x30CB;&amp;#x30AA;&amp;#x30F3;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n1&amp;#x756A;&amp;#x76EE;&amp;#x304C;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3001;2&amp;#x756A;&amp;#x76EE;&amp;#x306F;ID&amp;#x306E;&amp;#x81EA;&amp;#x52D5;&amp;#x751F;&amp;#x6210;&amp;#x3002;\n3&amp;#x756A;&amp;#x76EE;&amp;#x304C;&amp;#x30B3;&amp;#x30D4;&amp;#x30FC;&amp;#x7528;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30AF;&amp;#x30C8;&amp;#x30EA;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3002;\n4&amp;#x756A;&amp;#x76EE;&amp;#x304C;&amp;#x62BD;&amp;#x51FA;&amp;#x5B50;&amp;#x30E1;&amp;#x30BD;&amp;#x30C3;&amp;#x30C9;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  56. FieldMeta&amp;#x306F;ClassMeta&amp;#x306B;&amp;#x5F93;&amp;#x5C5E;&amp;#x3059;&amp;#x308B;&amp;#x305F;&amp;#x3081;&amp;#x3001;&amp;#x8B58;&amp;#x5225;&amp;#x304C;&amp;#x4E0D;&amp;#x8981;&amp;#x306A;&amp;#x5024;&amp;#x30AA;&amp;#x30D6;&amp;#x30B8;&amp;#x30A7;&amp;#x30AF;&amp;#x30C8;&amp;#x3067;&amp;#x3059;&amp;#x3002;case class&amp;#x3067;&amp;#x3055;&amp;#x304F;&amp;#x3063;&amp;#x3068;&amp;#x4F5C;&amp;#x308A;&amp;#x307E;&amp;#x3059;&amp;#x3002;BeanProperty&amp;#x306F;Freemarker&amp;#x5BFE;&amp;#x5FDC;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  57. &amp;#x6B21;&amp;#x306F;&amp;#x30EA;&amp;#x30DD;&amp;#x30B8;&amp;#x30C8;&amp;#x30EA;&amp;#x3067;&amp;#x3059;&amp;#x3002;&amp;#x4ECA;&amp;#x56DE;&amp;#x306F;&amp;#x30EA;&amp;#x30FC;&amp;#x30C9;&amp;#x30AA;&amp;#x30F3;&amp;#x30EA;&amp;#x30FC;&amp;#x306A;&amp;#x306E;&amp;#x3067;EntityResolver&amp;#x306E;&amp;#x307F;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n\n
  58. &amp;#x6B21;&amp;#x306F;&amp;#x30B3;&amp;#x30FC;&amp;#x30C9;&amp;#x751F;&amp;#x6210;&amp;#x30B5;&amp;#x30FC;&amp;#x30D3;&amp;#x30B9;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  59. &amp;#x6700;&amp;#x5F8C;&amp;#x306F;&amp;#x30A2;&amp;#x30D7;&amp;#x30EA;&amp;#x30B1;&amp;#x30FC;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  60. \n