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 ...

Get Seven Mobile Apps in Seven Weeks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.