{"id":18589,"date":"2017-08-25T09:30:50","date_gmt":"2017-08-25T16:30:50","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/?p=13526"},"modified":"2021-09-29T16:40:17","modified_gmt":"2021-09-29T23:40:17","slug":"xamarin-patterns","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/xamarin-patterns\/","title":{"rendered":"Mobile Apps with Xamarin.Forms: Architecture and Patterns guidance"},"content":{"rendered":"<p><img decoding=\"async\" width=\"2355\" height=\"257\" class=\"alignnone wp-image-14425 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2017\/08\/Xamarin-Patterns-Banner-3.png\" \/><\/p>\n<p>As part of the series of posts announced at this initial blog post (<a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2017\/07\/26\/the-new-net-application-architecture-guidance\/\">.NET Application Architecture Guidance<\/a>) that explores each of the\u00a0architecture areas currently covered by our team,\u00a0this current blog post focuses on &#8220;<strong>Mobile Apps with Xamarin.Forms: Architecture and Patterns guidance<\/strong>&#8220;.<\/p>\n<p>Just as a reminder, the four introductory blog posts of this series are (or will be as of today)\u00a0the following:\u00a0 <span style=\"font-size: 12pt\">\n<\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/?p=13546\">Microservices and Docker containers: Architecture, Patterns and Development guidance<\/a><\/li>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2017\/08\/09\/web-apps-aspnetcore-architecture-guidance\/\">Web Applications with ASP.NET Core Architecture and Patterns guidance<\/a><\/li>\n<li><a href=\"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2017\/08\/25\/xamarin-patterns\/\">Mobile Apps with Xamarin.Forms: Architecture and Patterns guidance<\/a><\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/modernize-existing-net-apps-with-windows-containers-and-azure\/\">Modernize existing .NET apps with Windows Containers and Azure<\/a><\/li>\n<\/ul>\n<p><span style=\"font-size: 12pt\"><span style=\"font-family: Arial\">There are many issues that must be resolved when creating an enterprise mobile app. These include: <\/span><span style=\"font-family: Times New Roman\">\n<\/span><\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial\">Deciding how to provide a clean separation of concerns between the user interface controls and their logic. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding whether to use a dependency injection container. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Choosing how components that are inconvenient to link by object and type references can communicate. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding how to navigate between pages, including how to invoke navigation and where navigation logic should reside. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding how to validate user input for correctness. The decision must include how to validate user input and how to notify the user about validation errors. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding how to perform authentication and how to protect resources with authorization. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding how to access remote data from web services, including how to reliably retrieve data and how to cache data. <\/span><\/li>\n<li><span style=\"font-family: Arial\">Deciding how to unit test the app.<\/span><span style=\"color: #1f4d78\">\n<\/span><\/li>\n<\/ul>\n<h3>Introducing the &#8216;Enterprise Application Patterns using Xamarin.Forms&#8217; Guide\/eBook<\/h3>\n<p><span style=\"font-family: Times New Roman;font-size: 12pt\">You can download this eBook that offers guidance on core patterns and architectural guidance for developing Xamarin.Forms enterprise apps that are easier to test, maintain, and evolve. Guidance is provided on how to implement the Model-View-ViewModel (MVVM) pattern, dependency injection, navigation, validation, and configuration management, while maintaining loose coupling. In addition, there&#8217;s also guidance on performing authentication and authorization with IdentityServer, accessing remote data from containerized microservices, and unit testing.\n<\/span><\/p>\n<p><span style=\"font-family: Times New Roman;font-size: 12pt\">Free download:\n<\/span><\/p>\n<p><a href=\"http:\/\/aka.ms\/XamarinPatternsEbook\"><span style=\"font-family: Times New Roman;font-size: 12pt\">http:\/\/aka.ms\/XamarinPatternsEbook<\/span><\/a><span style=\"font-family: Times New Roman;font-size: 12pt\">\n<\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2017\/08\/062217_2209_ThenewNETAp16.png\" \/><span style=\"font-family: Times New Roman;font-size: 12pt\">\n<\/span><\/p>\n<p><span style=\"font-family: Times New Roman;font-size: 12pt\">The eBook comes with source code for the <strong>eShopOnContainers Xamarin.Forms mobile app<\/strong>, which is a mobile app that extends the eShopOnContainers microservice\/containers scenario. This mobile app includes the following functionality:\n<\/span><\/p>\n<ul>\n<li>Authenticating and authorizing with a backend service.<\/li>\n<li>Browsing a catalog of shirts, coffee mugs, and other marketing items.<\/li>\n<li>Filtering the catalog.<\/li>\n<li>Ordering items from the catalog.<\/li>\n<li>Viewing the user&#8217;s order history.<\/li>\n<li>Configuring settings.<\/li>\n<\/ul>\n<h3>Who should use this guide<\/h3>\n<p><span style=\"font-family: Times New Roman;font-size: 12pt\">We wrote this guide for mobile app developers and solution architects who are new to Xamarin.Forms while looking to learn and adopt proven enterprise architectural\/design patterns and best development practices for Xamarin.Forms apps.\n<\/span><\/p>\n<h3>Related sample mobile Xamarin.Forms app<\/h3>\n<p><span style=\"font-size: 12pt\"><span style=\"font-family: Arial\">The eBook focuses on building cross-platform enterprise apps using Xamarin.Forms and uses the <a href=\"http:\/\/aka.ms\/MicroservicesArchitecture\">eShopOnContainers mobile app<\/a> as an example. The following diagram shows the pages from the eShopOnContainers mobile app that provide the functionality outlined earlier: <\/span><span style=\"font-family: Times New Roman\">\n<\/span><\/span><\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2017\/08\/062217_2209_ThenewNETAp17.png\" \/><span style=\"font-family: Times New Roman;font-size: 12pt\">\n<\/span><\/p>\n<p><span style=\"font-size: 12pt\"><span style=\"font-family: Arial\">The mobile app consumes the backend services provided by the containerized microservices. However, it can also be configured to consume data from mock services for those who wish to avoid deploying the backend services and just want purely explorer the Xamarin.Forms mobile app without the hassle of deploying a microservice-based backend. <\/span><span style=\"font-family: Times New Roman\">\n<\/span><\/span><\/p>\n<h3>Wrapping up \u2013 Xamarin.Forms Patterns guidance<\/h3>\n<p><a href=\"http:\/\/aka.ms\/XamarinPatternsEbook\"><span style=\"font-family: Arial;font-size: 12pt\">Enterprise Application Patterns using Xamarin.Forms<\/span><\/a><span style=\"font-size: 12pt\"><span style=\"font-family: Arial\"> focuses on core patterns and architectural guidance for developing Xamarin.Forms enterprise apps that are easier to test, maintain, and evolve. Guidance is provided on how to implement MVVM, dependency injection, navigation, validation, and configuration management while maintaining loose coupling. In addition, there&#8217;s also guidance on performing authentication and authorization with IdentityServer, accessing remote data from containerized microservices, and unit testing.\u00a0<\/span><\/span><\/p>\n<h3>Visit the .NET Application Architecture Center and grab it all!<\/h3>\n<p>Remember that this\u00a0<em>&#8216;Web Applications with ASP.NET Core Architecture and Patterns guidance&#8217; <\/em>explained at this blog post is part of a broader .NET Architecture guidance which covers additional subjects and you can\u00a0<a href=\"http:\/\/dot.net\/architecture\">check out at the .NET Application Architecture Center page<\/a>\u00a0where you can\u00a0download the multiple eBooks\/Guides and visit the reference applications from there, and of course, feel free to provide feedback by dropping a note below or on the feedback form at the architecture page.<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2017\/08\/062217_2209_ThenewNETAp2.png\" \/><\/p>\n<p>Happy coding from the .NET team!<\/p>\n<p>Cesar de la Torre<\/p>\n<p>.NET\u00a0Product Group<\/p>\n<p>Twitter:\u00a0<a href=\"https:\/\/twitter.com\/cesardelatorre\">@cesardelatorre<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the series of posts announced at this initial blog post (.NET Application Architecture Guidance) that explores each of the\u00a0architecture areas currently covered by our team,\u00a0this current blog post focuses on &#8220;Mobile Apps with Xamarin.Forms: Architecture and Patterns guidance&#8220;. Just as a reminder, the four introductory blog posts of this series are (or [&hellip;]<\/p>\n","protected":false},"author":362,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[100,162,163],"class_list":["post-18589","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-mvvm","tag-xamarin","tag-xamarin-forms"],"acf":[],"blog_post_summary":"<p>As part of the series of posts announced at this initial blog post (.NET Application Architecture Guidance) that explores each of the\u00a0architecture areas currently covered by our team,\u00a0this current blog post focuses on &#8220;Mobile Apps with Xamarin.Forms: Architecture and Patterns guidance&#8220;. Just as a reminder, the four introductory blog posts of this series are (or [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=18589"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18589\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=18589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=18589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=18589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}