📜 ⬆️ ⬇️

Lift: the most powerful and secure web framework of all?

A very ambitious statement can be seen on the official website of the project. In the same place it is offered to be convinced of it on examples . Personally, I find it difficult to judge, I used only Java web frameworks, and that is by no means all. Therefore, I will try to tell about it in more detail, and let everyone make his own conclusions.



The most important thing to note is the absence of the “best of all” statement. And this is understandable, if only because Lift is more complicated than most frameworks. Firstly, because it actively uses the functional side of Scala , and secondly, because Scala is a language with strong static typing. But, for those who are willing to learn, Lift is a really powerful tool (I know from experience, I have been using it for the past few months).

First, some background information.


Key facts:

As already mentioned, Lift actively uses the functional side of Scala. This is reflected firstly in the fact that you do not need to think about how to send and receive information from the client, how to transform it, what interfaces to implement and how to correctly connect them. Instead, you just write what to do . The simplest classic example: there is a button that, when clicked, sends a request to the server, some actions should be performed there, after which some response should be sent to the browser. We look at the code.
')
Template:
<button id="b">Push me</button>

Scala code:
"#b [onclick]" #> ajaxInvoke(() => {println("server"); Alert("client")})

We deduce in the console the message and we return javascript for performance on the client. Everything! Minimum code, maximum result. And this approach can be traced in all parts of the framework.

Seven things


from Lift, which are made much more difficult or not implemented at all in other frameworks:


And everything else


In addition to the above features, there is a whole necessary set:

Etc. etc. To all this, it is important to add the power of the Scala language itself, which, personally, after many years of working with Java, never ceases to please every day.

How to be with all this?


I tried to thoroughly do Lift 3 times over the last year. And somehow he could not grasp the essence, throwing. Even began to make a prototype of the web interface for working on Vaadin. But at the end of 2010, having tried again, I was able to figure it out and now I am terribly happy. I think that the reason for the unsuccessful attempts is mainly to get used to the functional approach. Java habits actually sit deep and interfere with thinking in another perspective.

Therefore, before seriously taking up the Lift, it is probably worth feeling confident in using the functionality of Scala .

All worthy books on Scala and Lift are either free or not hard to get. For Scala, the best option is Programming in Scala 2nd edition . I studied Lift mainly by examples from a distribution kit, a Wiki and a free book from the creator - Simply Lift . Well-designed questions quickly and efficiently respond either to StackOverflow or in Google groups on Scala and Lift .

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


All Articles