Patterns for Referencing Dependencies in Cross Platform Development

There are many ways to obtain a reference to a dependency in programming. You may have heard of patterns called Service Locator, Constructor Injection, Static Instances or even PubSub. All of these are valid patterns and have their uses, but there are also many incorrect ways to use them. Service Locator Service Locator is a […]

Read More >

Operation Separation

Operation Separation is my term for separating commands, think ICommand, that are called in a ViewModel, into a separate Operation class and then having a common service handling the result. This means the operation in a ViewModel does not actually cause the navigation or display of a dialog but merely processes user input and state into […]

Read More >

Misuses Of MessagingCenter

MessagingCenter is a global event messaging system designed to allow two separate entities communicate without knowing anything about each other, besides a simple messaging contract. This architectural style of system works well for larger systems such as Amazon who use a similar event-sourced approach of micro services to implement a recommendation system, payment system, shipping system […]

Read More >

Static Initialization

Constructor injection is a great way to keep all class dependencies easily visible in a constructor parameter list and makes unit testing easier. There are times when this isn’t possible such as another class initializes your class and you don’t have control of its construction. This presents a challenge. Normally this results in relenting to using a service […]

Read More >

Layered Dependency Injection

Introduction In a tiered architecture with Dependency Injection we have the problem that the bootstrapper or initialization section of your main project doesn’t have a reference to every project we need to inject into our container.  Therefore we end up referencing projects for the sole purpose of injecting them into the container. While there is technically no harm in doing […]

Read More >

Proxy Pattern To Separate Dependencies

Introduction Adding dependencies to your project is one of the biggest causes of project complexity. As the dependencies increase, so does the complexity. When developing frameworks (e.g. Exrin) this becomes an even bigger issue as you must continuously update your framework at the whim of your dependencies. When developing projects for your application, I prefer to […]

Read More >

Access a Control Method from a ViewModel

Making a control in your view MVVM friendly by allowing binding to your ViewModel, can be done in several different ways. When developing in the MVVM pattern, you have no access to the View and hence no access to the methods on a Control. Most controls in Xamarin Forms have bindable properties but some do not. […]

Read More >

Xamarin Forms Architectural Guidance

With every project I keep learning something new, better ways to structure code. I always left the project feeling not quite right when I didn’t implement code in the best way I knew how. Project deadlines, bugs and more sometimes leaves a project with hacks and workarounds just to get the job done, hence the […]

Read More >