Question

I'm just beginning to look at the Haxe language, primarily for flash development, but once I'd seen what Neko can do, also the desktop and web server side of things too.

I sort of have my head around the flash side of things - just need to play with it a bit more, but I'm a bit lost when it comes to creating an MVC web site with it.

What would you suggest when it comes to building the web site ( this would be just a basic site with different sections to understand controllers/actions/ids )? I know that PureMVC is a fairly well established framework, but in this case how (if) could it be implemented?

I'm hoping for something along the lines of ASP.NET MVC, which I've breifly had a look at, but not had time to use properly.

Many thanks for any advice.

Was it helpful?

Solution

Haxe is good for it cause MVC is very natural for OO(not object capable alike PHP). Keep in mind MVC is more of a concept, so it very general the way its implemented is up to you.

Things to remember. Haxe has single entry point, meaning all your urls have to be pointed to a certain haxe(php) file which has "main" class/function. (You have to make a simple .htaccess which would repoint all urls to this "main" function) Side notes: you can compile each file to be separate app kind'a like php but I would not recomended.

This entry point should eventually initilize some class let's call it a dispatcher. So called dispatcher will identify the url/uri php.Web.getURI() and based on that will fire up apriopriate class/function and perhaps with some parameters from url.

Another thing to remember is that you cannot do code spaghetti (a'la PHP). You have to use some sort of templating enginge or write a simple one yourself. Haxe has two template engines one is haxe.template (very simple) and another one is Templo (very decent and powerful).

With that in mind you should be able to start cracking the subject ;]

OTHER TIPS

HaQuery is a new Haxe web framework. For details, you may look to http://haquery.com/.

Using Haxe on the client side should free you from the need to build HTML on the server side at all. Your client could get all its data from simple REST web services and do all the UI work in the browser. Very efficient and scalable.

You could even write those REST web services in haxe if that is what you are familiar with: http://www.haxenode.org/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top