O'Reilly logo

Seven Mobile Apps in Seven Weeks by Tony Hillerson

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

Day 2: Dividing Up the Solution

Or, Building a Shared Business-Logic Layer

Today we’ll build the shared business logic of the calculator. Xamarin’s ability to share a project among multiple platform-specific projects is one of its strong suits. It allows us to write business logic once and share it to multiple projects.

Building a Shared Calculator Model

The business logic for a calculator isn’t extremely complex, but it does have a few gotchas if we don’t code it correctly. With that in mind, we’ll build the model testing first.

Testing the Calculator Model

images/src/Xamarin/15_failing_test.png

First, get the tests that Xamarin Studio generated working, or at least not failing. Then ...

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