I am taking the first steps using scala.
I created PhotosLoaderActorone that takes care of loading the image and storing it in the cache. For this, I will have CacheActorand DownloadActor.
My PhotosLoaderActorhas the following:
override def act() {
loop {
react {
case (caller : Actor, photoToLoad:String) => {
I just found out what I can use case classesto use something like this:
case class LoadImage(caller: Actor, photoToLoad: String)
override def act() {
loop {
react {
case LoadImage(caller, photoToLoad) => { // bla bla }
My question is:
Where should I identify case classes? If I call PhotosLoaderActorfrom another package, will importing this actor also import case classes? What is the practice?
source
share