Android navigation description

Source: Internet
Author: User
Tags url forwarding

Of course, Android navigation is a bit uncomfortable for people like ahuaxuan who just stepped out of the java World, because process-based data sharing is troublesome, such as writing an ip address query component, I hope you can learn and think about it.

Freemarker is the most complex and powerful. Supporting jsp tag embedding allows us to reuse many existing components, I have also described this in detail in my previous article (join hands to see the combination of freemarker and displaytag ). Because of understanding, you can have the right to speak. django's template can be said to have been born for Internet applications. Its concise and fast development features are quite appealing. The basic syntax of most template languages is similar.

For example, in the Android navigation, the explicit value is $ {}, while in django is {}, in freemarker, if is judged as <# if> </# if>, while in django is: django has two forms. One is to define the form class, and the other is to define the automatic form class through the model we define. Ahuaxuan only provides a small example of information publishing.

Therefore, you cannot fully understand or understand all the details of form in django, I do feel that django's practice of creating a form from a model is quite limited. In many cases, the data in the model is not from the page. In this case, after the form object is constructed, ahuaxuan has not found the method to modify the median of the form.

The custom form class is also troublesome, that is, to write your own model. This is different from our previous practice. Here, form represents the value object in java, and model is the domain object, in our ssh framework, we usually inherit the value object from our domain object.

Although a bunch of people have raised objections and said they want to separate the two objects because they are at different levels, we can see from practical experience that, there is nothing wrong with this. However, the separation of custom form and model in django may be in line with the psychology of some people. However, Custom forms are also commendable. In form, we can customize verification rules. At the same time, we can directly generate content on the page based on the form object, however, this is actually quite troublesome.

It is troublesome to change the style. However, in general, django's form is quite characteristic, and it brings us convenience to a certain extent. Django's url-based forwarding is based on regular expressions. Some people are good, some are bad, and I am one of them. Url forwarding should be very clear.

This is a very bright thing, but after using this regular expression to match something, I am depressed, so I can only go back to the distant past to bypass this stuff, I don't have to always do it. According to the current knowledge, what is in django's views is actually controller. Why is it called views? I don't know, but it has always been used.

Even in nature, a lot of things are not quite the same on the surface. In fact, the internal principle is the same. I think django views is the action in struts1.x. Why, let's take a look at the two comparison codes. The first part is django and the second part is struts1.x.

Before starting this part, I also want to talk about the state of a topic that we have been talking about and will continue to talk about in the future. We have been discussing how to save the user's status in a centralized place, especially in the case of large-scale cluster deployment.

Similarly, this is true for Android navigation. It can be said that this golden rule is not only for a certain language or framework, but also for a higher level concept. So where can we put the status? Currently, some popular options are DB (memory table, or entity table ).

Android navigation, or cookie, but these options are not interchangeable. For example, when there is a large amount of business data, it is not suitable to store them in cookies, because it may exceed the cookie size limit, put it in memcached.

Unfortunately, memcached (when slab is used) also has its own restrictions. If the status data size span is large, data loss may occur, ahuaxuan encountered this situation long ago in the test environment. This was not the case because the online memcached was too large, the internal cause of this event has been described in another ahuaxuan article.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.