Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Android Navigation

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Of course, Android navigation is a bit uncomfortable for people like ahuaxuan who have just stepped out of the java world, because process-based things are troublesome to share data, such as writing an ip query component. I hope you can learn to think.

The most complex and powerful is freemarker, supporting the embedding of jsp tag allows us to reuse many existing components, which I have described in more detail in previous articles (see the combination of freemarker and displaytag). As a result of understanding, there is a voice, the template of django can be said to be born for Internet applications, and people can't help but like the characteristics of simplicity and rapid development. The basic syntax of most template languages is similar.

For example, the value shown in Android navigation is ${}, while in django it is {{}}, in freemarker if is judged to be, and in django it is: Django has two kinds of form. One is to define the form class yourself, and the other is to automatically form class through the model we define. Because ahuaxuan only makes a small example of information release.

So I can't fully understand or understand all the details of form in django, but from what I've covered, I do feel limited by django's approach to creating forms from models. Because most of the time, the data in model does not come from the page, in this case, after the form object is constructed, ahuaxuan has not found a way to modify the value of form.

And custom form class is also troublesome, that is, to write their own model, which is quite different from our previous practice, where form represents that value object,model in our java is domain object, and in our ssh framework we usually inherit value object from our domain object.

Although a lot of people have raised objections, saying that the two objects should be separated because they are at different levels, we can see from practical experience that there is nothing wrong with doing so. On the other hand, the behavior of defining the separation of form and model in django may be more in line with the psychology of some people. However, the custom forms also has some commendable places. In form, we can customize the verification rules, and we can generate the content in the page directly according to the form object, but this actually has some troubles.

That is, it will be troublesome if you want to change the style. However, on the whole, the form of django is quite characteristic, and it brings convenience to us to a certain extent. Django's url forwarding is based on regular expressions, some people applaud, some people call bad, and I am one of those people called poor. Url forwarding should be a very clear one.

Something very bright, but after using this regular expression match, I was depressed, so I had to go back to the distant past to get around it. I didn't always have to. Judging from the current knowledge, what is in django's views is actually controller, why is it called views? I don't know, but it's been used all the time.

Even in nature, there are many things that are not quite the same on the surface, but in fact, the internal principle is the same. I think the views of django is the action of struts1.x. Why do you say that? let's take a look at two pieces of code that compare. The * * paragraph is django and the second paragraph is struts1.x.

Before this section begins, I would also like to talk about a topic that we have been talking about before and will continue to talk about in the future-status. We have been talking about keeping the user's state in a centralized place, especially in the case of large-scale cluster deployment.

Similarly, for Android navigation, it can be said that this golden rule is not just for a certain language, a certain framework, it should be a higher-level concept. So where can we put the status? at present, some of the popular choices are DB (memory table, or entity table).

Android navigation, or cookie, but these options are not easily interchangeable. For example, when there is a lot of business data, it is not appropriate to put it in cookie, because it may exceed the limit of cookie size, so put it in memcached.

Unfortunately, memcached (in the case of using slab) also has its own limitations. If the size span of the state data is large, then data loss may occur. Ahuaxuan encountered this situation in the test environment a long time ago, and this did not happen because the online memcached is on a large scale. The internal causes of such events have been described in great detail in another ahuaxuan article.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report