Haxe NME UI: Best MVC Application Development Practices

I stumbled upon the Haxe NME project yesterday, which is a very promising idea. However, it is still not possible to create complex interfaces with this infrastructure. In my opinion, it seems like a daunting task to create a user interface infrastructure focused on many different platforms, so I think this is not a viable approach, because even old and mature user interface interfaces like Qt and wxWidgets do not support many platforms.

However, it makes sense to create an interface with a specific platform using some tool to create a user interface, and then connect the user interface code to the agnostic code of the user interface that was written in Haxe. I don’t know if this might work, because I could not find a single example, but maybe someone who has already written MVC Haxe code that can be successfully connected to various platform user interfaces would like to share my experience . Thanks.

+4
source share
3 answers

You speak:

However, it is still not possible to create complex user interfaces.

Just because you haven’t yet figured out how to do this does not mean that it is impossible;)

The reason is that in the Haxe ecosystem, the language and the compiler are extremely consistent cross-platform, NME / OpenFL provides a fairly simple cross-platform rendering environment (HTML 5 has some quirks, but others look quite strong) and therefore everything you build on top of them, will cover many platforms out of the box. It's about a fairly high level - letting the compiler and libraries take care of the platform quirks.

In MVC, UI stuff is usually " V iew". For views / user interfaces, check out these libraries:

  • Stablex User Interface
    NME / OpenFL, cross platform . Draws components using the NME API. This is the only thing I've played with, but the demo works sequentially on android, flash, html5, native linux. Pretty impressive.

  • Haxeui
    NME, cross platform . Again, draws components on stage.

  • Prime
    Running using the Flash API. Not sure if it is ported to the platform. See Also Talk / Video from the WWX Conference and Slides

  • Guise
    A truly innovative way to be able to either draw a user interface or use native, if available. Check out the blog post.

  • Basis
    Another attempt to wrap our own components - there are still iOS and Android libraries. Pretty cool, but I haven't played with him yet.

There are many options for MVC:

  • PrimeVC mentioned above.
  • MMVC , based on the RobotLegs framework, but specifically designed for Haxe.
  • Many small options BBMVC PureMVC etc

The advantage of MVC structures is that they separate your views from your application data (model) and logic (controller). Try spending some time familiarizing yourself with one of the MVC infrastructures, and you will see how you can write your applications in such a way that you can use one of them, and then any of the various viewing mechanisms β€” either native or NME β€” are rendered. It can be a pretty steep learning curve, but that’s how you create applications that easily transfer between different user interface interfaces and are easy to check, so you know that they will scale as the application gets more complex.

+12
source

The main problem that you seem to encounter is that there is no ready-to-use option for you. A lot of people in the project propose doing what you want. You must be prepared to use them. A small github project can be dropped. If so, it will be reset because jo uses it so that it can be used by people who would like to use it (i.e.: you) to keep it going.

Everyone cannot siphon other completed projects or nothing will be created. Participation is what openource is.

0
source

It does not make sense to have a unified interface for all platforms, each platform has different workflows, you tried to use the IOS list in windows, it’s just ridiculous. On the other hand, good design can separate the look from the logic of the business, and you can share the logic of the business with all goals and customize points of view for each goal. look PureMVC
for example mvc in Haxe

0
source

Source: https://habr.com/ru/post/1488831/


All Articles