6 Development Strategies

Extensibility application developers can write their extensions for the Simphony POS using .net assemblies or SIM. SIM is available on all platforms: Microsoft Windows, Linux, and Android. .NET assemblies are available only on Microsoft Windows and Linux. It is important to consider that .NET assemblies do not load on Android.

Multi-platform .NET Assembly Development

You can write a single .NET assembly that runs on both Microsoft Windows and Linux. As with any multi-platform development, make sure to either abstract out OS-specific logic in the same assembly, or refactor into a different assembly.

If you are starting an extensibility application from scratch, Oracle recommends partitioning the code to account for platform differences.

Porting from Microsoft Windows to Linux

If a Microsoft Windows application exists, porting it to run on both Linux and Microsoft Windows may be a challenge. This is true for all multiplatform development, and not just Simphony.

Many applications are replete with Microsoft Windows-specific code, from trivial (directory separators) to architectural (dozens of WPF dialogs and Microsoft Windows device drivers). While it may be desirable to maintain one assembly for your application, time and resource constraints may force the application to have a Microsoft Windows assembly and a Linux assembly.

Consider this scenario: A developer develops an extensibility application for Microsoft Windows and now wants to port it to Linux. The DLL will not run on Linux as-is because it references Microsoft Windows-specific assemblies. Possible solutions are:
  • Create two separate versions of the same application and mark them as Microsoft Windows-only or Linux-only in the EMC configuration.
  • Create one application assembly that runs on both Linux and Microsoft Windows and abstract out the OS-specific functionality into separate assemblies. (The Simphony core code uses this strategy.)
  • Make runtime decisions in code based on OS type.
  • Take advantage of .NET runtime for directory separator, combining paths.

There is no universal best practice strategy for refactoring assemblies to run on Linux and Microsoft Windows. The decision depends in part on how tightly the application is bound to Microsoft Windows and how much effort can be devoted to refactoring.

Building a Cross-Platform Assembly

Developing and troubleshooting extensibility applications is more difficult on Linux than Microsoft Windows. Frequently, extensibility assemblies have Microsoft Windows-specific references, but they are hard to reconcile. To determine if code will load on Linux, Oracle recommends downloading the mono compiler on Microsoft Windows and building the extensibility application solution. Any Microsoft Windows-specific references then result in a compile-time error.

In general, if the same extensibility solution successfully compiles using Visual Studio and Mono, then it should load on both platforms. The custom HTML5 dialog feature works identically on Microsoft Windows and on Linux. Speed development by first testing the custom dialog on Microsoft Windows and then on Linux.