from Ui import Console from Business import ServiceRoom, ServiceReservation from Repository import FileRepo from Validators import ValidateReservation from Domain import Room, Reservation validateReservation = ValidateReservation() repoRooms = FileRepo('rooms', Room.read_room, Room.write_room) repoReservations = FileRepo('reservations', Reservation.read_reservation, Reservation.write_reservation) validateReservation = ValidateReservation() serviceReservation = ServiceReservation(repoReservations, repoRooms, validateReservation) serviceRoom = ServiceRoom(repoRooms) console = Console(serviceReservation, serviceRoom) console.run()
from Repository import FileRepo from Validators import ValidateSentence from Controller import SentenceController from Ui import Console repoSentences = FileRepo('sentences') validateSentence = ValidateSentence() sentenceController = SentenceController(repoSentences, validateSentence) console = Console(sentenceController) console.run()
from Ui import Console from Controller import Controller from Repository import Repo from Validators import Validate repoGame = Repo() validate = Validate() controller = Controller(repoGame, validate) console = Console(controller) console.run()
from Repository import RepoShips from Validators import ValidateShip, ValidatePoint from ShipsController import ShipController from Domain import Ship, Point from Ui import Console repoShips = RepoShips() repoComputer = RepoShips() #repoShips.add(Ship(Point('A', '1'), Point('A','2'), Point('A', '3'))) #repoShips.add(Ship(Point('D', '1'), Point('D','2'), Point('D', '3'))) validateShip = ValidateShip() validatePoint = ValidatePoint() shipController = ShipController(repoShips, validateShip, validatePoint) computerController = ShipController(repoComputer, validateShip, validatePoint) console = Console(shipController, computerController) console.run()
from Domain import Student, Grades from Repository import StudentRepo, GradeRepo from Controller import StudentController, GradeController from Ui import Console # Create the repositories studentRepo = StudentRepo('students', Student.write_student, Student.read_student) gradeRepo = GradeRepo('grades', Grades.write_grades, Grades.read_grades) # Create the controllers studenController = StudentController(studentRepo) gradeController = GradeController(gradeRepo, studentRepo) # Create the console console = Console(studenController, gradeController) console.run()
from Ui import Console from Controller import GameControler from Repository import Repo from Validate import Validate repoGame = Repo() validate = Validate() gameController = GameControler(repoGame, validate) console = Console(gameController) console.run()
from Ui import Console from Controller import PlayerController, ComputerController from Validators import Validate from Repository import Repo validate = Validate() repoPoints = Repo() repoCPoints = Repo() playerController = PlayerController(validate, repoPoints) computerController = ComputerController(validate, repoCPoints) console = Console(playerController, computerController) console.run()