Skip to content

Instantly share code, notes, and snippets.

View godrm's full-sized avatar

Jung Kim godrm

  • Codesquad
  • Seoul, KOREA
  • X @godrm
View GitHub Profile
//
// ViewController.swift
// HelloAnimation
//
// Created by JK on 19/04/2018.
// Copyright © 2018 JK. All rights reserved.
//
import UIKit
//
// main.swift
// HugeLadderGame
//
// Created by JK on 21/08/2018.
// Copyright © 2018 codesquad. All rights reserved.
//
import Foundation
class Entity {
var name : String = ""
init(name : String) {
self.name = name
}
}
class Order {
private (set) var id = UUID()
private (set) var date = Date()
class Customer :
Entity,
AggregateProtocol
{
private (set) var id : UUID
private (set) var email : String
private var orders : Array<Order>
//...중간생략...
class Product {
private var id = UUID()
}
class CustomOrderRequest {
private (set) var products = [Product]()
}
protocol OrderCommand {
protocol CustomerRepositoryProtocol {
}
protocol ProductRepositoryProtocol {
}
struct ConversionRate {
var fromCurrency : String
class CustomerOrderController {
private (set) var orderService : OrderService
init(service: OrderService) {
self.orderService = service
}
}
class CustomOrderRequest {
private (set) var products = [Product]()
}
protocol OrderCommand {
//
}
protocol OrderManagerProtocol {
func send(command : OrderCommand)
class Customer :
Entity,
AggregateProtocol
{
private (set) var id : UUID
private (set) var email : String
private var orders : Array<Order>
init?(email : String, name : String, uniqueChecker : CustomerUniqueCheckerDelegate) {
id = UUID.init()
protocol CustomerRepositoryProtocol {
}
protocol ProductRepositoryProtocol {
}
struct ConversionRate {
var fromCurrency : String