-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Weber
committed
Apr 14, 2016
1 parent
c7d0ed4
commit b6d10b9
Showing
17 changed files
with
79 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 2 additions & 13 deletions
15
...trains/impl/shunting/ShuntingModule.scala → ...haos/examples/trains/ShuntingModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/StationModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package mesosphere.chaos.examples.trains | ||
|
||
import com.softwaremill.macwire._ | ||
import mesosphere.chaos.examples.trains.impl.station.{TrainDispatch, TrainStation} | ||
|
||
@Module | ||
trait StationModule extends ShuntingModule with LoadingModule { | ||
lazy val trainDispatch = wire[TrainDispatch] | ||
lazy val trainStation = wire[TrainStation] | ||
} |
9 changes: 9 additions & 0 deletions
9
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/StatsModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package mesosphere.chaos.examples.trains | ||
|
||
import com.softwaremill.macwire._ | ||
import mesosphere.chaos.examples.trains.impl.stats.{LoadingStats, ShuntingStats} | ||
|
||
class StatsModule(shuntingModule: ShuntingModule, loadingModule: LoadingModule) { | ||
lazy val loadingStats = wire[LoadingStats] | ||
lazy val shuntingStats = wire[ShuntingStats] | ||
} |
14 changes: 14 additions & 0 deletions
14
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/TrainStation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package mesosphere.chaos.examples.trains | ||
|
||
object TrainStation extends App { | ||
val traditionalModules = new TraditionalShuntingModule | ||
with LoadingModule | ||
with StationModule | ||
|
||
val modernModules = new ModernShuntingModule | ||
with LoadingModule | ||
with StationModule | ||
|
||
println(traditionalModules.trainStation.prepareAndDispatchNextTrain()) | ||
println(modernModules.trainStation.prepareAndDispatchNextTrain()) | ||
} |
8 changes: 0 additions & 8 deletions
8
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/TrainsModule.scala
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/impl/TrainStation.scala
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...amples/src/main/scala/mesosphere/chaos/examples/trains/impl/loading/CraneController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package mesosphere.chaos.examples.trains.impl.loading | ||
|
||
class CraneController() |
6 changes: 6 additions & 0 deletions
6
...s-examples/src/main/scala/mesosphere/chaos/examples/trains/impl/loading/TrainLoader.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package mesosphere.chaos.examples.trains.impl.loading | ||
|
||
import mesosphere.chaos.examples.trains.impl.shunting.PointSwitcher | ||
|
||
class TrainLoader(craneController: CraneController, | ||
pointSwitcher: PointSwitcher) |
5 changes: 5 additions & 0 deletions
5
...xamples/src/main/scala/mesosphere/chaos/examples/trains/impl/shunting/PointSwitcher.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package mesosphere.chaos.examples.trains.impl.shunting | ||
|
||
class PointSwitcher() { | ||
def switch() = println("switch") | ||
} |
3 changes: 3 additions & 0 deletions
3
...mples/src/main/scala/mesosphere/chaos/examples/trains/impl/shunting/TrainCarCoupler.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package mesosphere.chaos.examples.trains.impl.shunting | ||
|
||
class TrainCarCoupler() |
6 changes: 6 additions & 0 deletions
6
...examples/src/main/scala/mesosphere/chaos/examples/trains/impl/shunting/TrainShunter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package mesosphere.chaos.examples.trains.impl.shunting | ||
|
||
trait TrainShunter { def shunt() = println("shunt")} | ||
class TraditionalTrainShunter(pointSwitcher: PointSwitcher, | ||
trainCarCoupler: TrainCarCoupler) extends TrainShunter | ||
class TeleportingTrainShunter() extends TrainShunter |
35 changes: 0 additions & 35 deletions
35
...examples/src/main/scala/mesosphere/chaos/examples/trains/impl/station/StationModule.scala
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...examples/src/main/scala/mesosphere/chaos/examples/trains/impl/station/TrainDispatch.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package mesosphere.chaos.examples.trains.impl.station | ||
|
||
class TrainDispatch() |
11 changes: 11 additions & 0 deletions
11
...-examples/src/main/scala/mesosphere/chaos/examples/trains/impl/station/TrainStation.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package mesosphere.chaos.examples.trains.impl.station | ||
|
||
import mesosphere.chaos.examples.trains.impl.loading.TrainLoader | ||
import mesosphere.chaos.examples.trains.impl.shunting.TrainShunter | ||
|
||
class TrainStation(trainShunter: TrainShunter, | ||
trainLoader: TrainLoader, | ||
trainDispatch: TrainDispatch) { | ||
|
||
def prepareAndDispatchNextTrain() = "Choo choo" | ||
} |
11 changes: 2 additions & 9 deletions
11
chaos-examples/src/main/scala/mesosphere/chaos/examples/trains/impl/stats/StaatsModule.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
package mesosphere.chaos.examples.trains.impl.stats | ||
|
||
import com.softwaremill.macwire._ | ||
|
||
import mesosphere.chaos.examples.trains.impl.loading.{LoadingModule, TrainLoader} | ||
import mesosphere.chaos.examples.trains.impl.shunting.{ShuntingModule, TrainShunter} | ||
import mesosphere.chaos.examples.trains.impl.loading.TrainLoader | ||
import mesosphere.chaos.examples.trains.impl.shunting.TrainShunter | ||
|
||
class LoadingStats(trainLoader: TrainLoader) | ||
class ShuntingStats(trainShunter: TrainShunter) | ||
|
||
class StatsModule(shuntingModule: ShuntingModule, loadingModule: LoadingModule) { | ||
lazy val loadingStats = wire[LoadingStats] | ||
lazy val shuntingStats = wire[ShuntingStats] | ||
} |
6 changes: 3 additions & 3 deletions
6
...ns/impl/shunting/ShuntingModuleTest.scala → .../examples/trains/ShuntingModuleTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters