object Main extendsApp {
// Create actor system
given system: ActorSystem = ActorSystem("akka-grpc-server")
given ec: ExecutionContextExecutor = system.dispatcher
given mat: Materializer = Materializer(system)
// Set up the gRPC service handler
val engine = pieris.app.Main.engine
val service = new EcServiceImpl(engine)
val handler = EcServiceHandler(service)
// Bind gRPC service
val grpcBindingFuture: Future[Http.ServerBinding] =
Http(system).newServerAt("localhost", 8080).bind(handler)
}
gRPC/Mian.scala
41.
class EcServiceImpl(engine: Engine)(usingmat: Materializer, ec: ExecutionContext)
extends EcService {
override def addCart(in: AddCartRequest): Future[AddCartResponse] = Future {
given ctx: CFExecutionContext =
engine.toExecutionContext(in.executionContext.toByteArray).get
val s = Main.ec
val cmd = AddCartCommand.create(in.productId, in.count)
val r = s.addCart(cmd)
r.map(x => AddCartResponse(x.cart_id.id)).get
}
}
gRPC/EcServieImpl.scala
参考文献
• The UnifiedModeling Language Reference
Manual, 2nd (Rumbaugh他, 2004)
• The Unified Modeling Language User Guide,
2nd (Booch他, 2004)
• The Unified Software Development Process
(Jacobson他, 1999)
• The Object Constraint Language, 2nd (Warmer
他, 2003)
• UML 2 and the Unified Process: Practical
Object-Oriented Analysis and Design (Arlow
他, 2005)
• OMG Unified Modeling Language Version 2.5
(OMG, 2015)
• 上流工程UMLモデリング (浅海, 2008)
• The Essentials of Modern Software
Engineering: Free the Practices from the
Method Prisons! (Jacobson他, 2019)
60.
まとめ
• ケーススタディ
• ブック・カフェPierisBooksの販売システム
• プラクティス
• Make Cloud Native CBD
• アクティビティ
• Define the System Architecture
• Finalize the SubSystem Specification
• Develop the Internal Structure of the SubSystem
• Develop the Domain Model
61.
参考文献
• The UnifiedModeling Language Reference
Manual, 2nd (Rumbaugh他, 2004)
• The Unified Modeling Language User Guide,
2nd (Booch他, 2004)
• The Unified Software Development Process
(Jacobson他, 1999)
• The Object Constraint Language, 2nd (Warmer
他, 2003)
• UML 2 and the Unified Process: Practical
Object-Oriented Analysis and Design (Arlow
他, 2005)
• OMG Unified Modeling Language Version 2.5
(OMG, 2015)
• 上流工程UMLモデリング (浅海, 2008)
• The Essentials of Modern Software
Engineering: Free the Practices from the
Method Prisons! (Jacobson他, 2019)