O'Reilly logo

Functional Web Development with Elixir, OTP, and Phoenix by Lance Halvorsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Call the Logic from the Interface

We’ve seen that we can start a new game from within an IEx session begun with iex -S mix phx.server. That means we can call the public functions of the IslandsEngine.Game module from any Phoenix component.

At the beginning of this chapter, we talked a lot about decoupling the interface from the business logic. We made a bold claim and said that this would make our work trivially easy. Throughout the chapter, we’ve shown how we can keep the two separated but included in a common project. What we haven’t yet shown is how those two will communicate. It’s time to back up that claim.

We’re going to walk through this pretty quickly. We’ll be working with a few new files, but we won’t be spending a lot of time explaining ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required