What does Scala lift wiring do?

I am looking at the Scala web framework. I recently saw something called Posting and wondered if anyone could explain the benefits to me as an application programmer.

+4
source share
4 answers

Posting gives you the ability to declare relationships between different elements on an HTML page and change predicate values, dependent values ​​will be automatically updated on the page.

Think about the difference between a spreadsheet and a Java / Scala program. In a spreadsheet, you can declare complex relationships between cells and when the predicates change, the cells are automatically updated. Writing a program that reflects even a fairly simple spreadsheet usually runs in hundreds or thousands of lines and will be very difficult to maintain.

A specific example is a shopping basket. Think about all the parts of the web page that you need to refresh when you put something in the basket. Writing a home screen can be tricky, but then think about the complexity of the service (it's good that I need to update when something is added or removed from the trash, when the zip code changes, etc.)

What posting gives you the opportunity to declare a relationship and no matter how the predicates change (for example, changing tax rules based on a zip code, but everything that depends on the taxable subtotal is updated when the tax rules change), the developer doesn’t dependents who also need to be updated.

+7
source

Connection (see demo ) allows you to have several input fields (or cells) from each other and automatically receive results for dependent cells. - And all this without a JavaScript string in a very declarative form.

As you can see in the demo, all you do is declare how the cells depend on each other, and then how they are displayed. There is no need to write or call auxiliary functions for connecting cells.

+5
source

Have you read the posting announcement on the Lift mailing list? https://groups.google.com/forum/#!searchin/liftweb/wiring/liftweb/WwLuiK3x0K4/e44Rm1325p4J

Also, both demos should help: http://demo.liftweb.net/simple_wiring as well as http://demo.liftweb.net/invoice_wiring

I understand the appeal of StackOverflow, but the mailing list is the gold ore of elevator information.

+3
source

You can also check the reactive network ( http://reactive-web.tk ), as it adds the same features as Lift in a much more powerful way.

+1
source

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


All Articles