开发者

Validity of GUI design patterns under linux

I am investigating a switc开发者_运维知识库h from windows to linux and i struggle to find samples of design patterns applied in this world.

The application is a classic client server with detailed forms for each business entity.

It will be taking user input, do some validation checks, a few calculations, and save them to database.

It will also have lists summarizing entities, and searches among these entities.

A click to one item of these lists will open the detailled forms.

If i use python or ruby, what should i use for GUI ?

And what pattern : is MVC, MVVM or MVP any good ?

Or is there anything better ?

Note : I have never done web developpement, and i would like to avoid to have to learn both linux and web developpement at the same time.


When you go Python, have a look at Qt (Python bindings to choose from: PyQt or PySide). Qt is a really nice / feature complete / mature cross-platform GUI library (which also does some other things).

As far as Python bindings are concerned, PyQt is GPL or commercial at the moment / PySide is LGPL (if licenses matter).

These 'patterns' you speak of (MVC, ...) can be applied cross-platform. What would be the best fit really depends on what type of application you are writing.


Given how you explain your application in a comment, while fully endorsing Qt, I would also recommend you consider the many advantages that could come your way from making your application a web app.

Since you say it's a client-server app, it needs (at least) local network connectivity at least, so the first objection typically raised against web apps is nullified.

The first huge advantage is that you wouldn't be choosing one client platform vs another -- just support modern cross-platform browsers like Firefox or Google's Chrome, and your customers will be able to pick whatever client platform(s) they prefer (if you also carefully check your app on Safari, which has much rendering logic in common with Chrome via the Webkit framework, your web app will then be usable on iPad too).

The second big win is that your app won't require any "installation" on the client(s) -- it will always be ready.

Modern Javascript frameworks (such as jQuery, Dojo, Closure, ...) allow heavy interactivity if you need it, support GUI building with UI widgets &c, and incidentally take care of most cross-browser differences on your behalf. On the server side, with either Ruby or Python (or other languages yet), you can even find frameworks that smoothly integrate with the client-side Javascript resources.

Oh, and, the computational resources needed to run the application (such as RAM, CPU power, disk space, ...) are cheaper "in bulk" on a server, or small group of servers, and thus shared among those clients which are active at a given time, than spread out over many clients (including many who won't happen to be active at any givem time;-).

Really, in my opinion, there is little left today to recommend local GUI apps when you're developing anew anyway, save possibly the need to run when cut off from all connectivity (and, even there, with HTML5 and the like, browsers are making great strides towards empowering such apps).


The two main UI toolkits in Linux these days are Qt and GTK+. Qt is widely used by the KDE desktop, while GTK+ is widely used by Gnome. But a Qt app will run in Gnome and vise-versa. Both toolkits have bindings to a massive amount of languages.


Design (or architectural) patterns have nothing to do with the target programming language or operating system. Ook at you problem, if you can see you requirements which will be fulfilled by some solution provided by a pattern and the consequences will be good, jsut use the pattern. If you aks MVC, MVP, MVVM etc. look at those patterns and problems they solve and if it is what you need for you application, use them.


You might want to look at Mono. It's basically cross-platform .NET. You could write your app once and run it on Windows or Linux (and easily port it to Android or iOS). You can also look into Moonlight, the open source version of Silverlight if you want to focus on an MVVM pattern. Leveraging .NET will make it a lot easier to move to a web application framework. As a benefit you can do your development on either Windows, Linux, or Mac.

If you need database access, and are going to go with .NET, I'd recommend dblinq and a MySql backend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜