Go straight to the topic and talk less about it.
The company's form and Team status directly affect our selection of development frameworks. As stated in the previous article, our low-cost development team is more focused on fast and saving. The framework should be open-source without additional costs; the development should be fast, and the customer needs should be followed up more quickly;CodeEasy to use, any trainedProgramAlmost all members are competent.
The leader has always instilled in us the concept of rapid development, which I will continue here. I do not know whether it is different from agile development. I have no idea about the concept. I am very grateful to anyone who can answer my doubts. Fast, it is very important to a light team like ours, and it is almost the most important factor. It is impossible for us to build a project within three or two years. In this way, we have invested too much, but are we sure we can recover it. In addition, code simplicity is also an important factor, because our team is a quick combination, which may frequently mobilize people and leave a few people. It is easier to simply hand over the code.
L ml is born in this case. I am not a master, so lml is not perfect.
First, lml is based on SSH. The castle framework, which has been used by the company for a long time, is simple and simple. It is perfect without the pursuit of operational efficiency. Of course, thanks to a manager who brought it to the company. However, after all, others are others', and they feel that they are the best. My skills are limited, and I am not able to create a framework comparable to Castle from the very beginning on the Java platform. Standing on the shoulders of giants is not complicated. SSH is a well-known open-source Java Web framework. It is mature and stable, and its usage is relatively reliable. As a result, SSH is encapsulated and transformed to form a set of framework ideas.
Second, the template engine of lml uses velocity, which has simple syntax and can easily generate templates using code generation tools such as codesmith. This is in line with the simple code principle! Another reason for using velocity is that we are in. Net has been using nvelocity, and their syntax is very similar. Most of the code can be transplanted without modification. This will be an example in the future.
Third, lml supports layout. Both frame and embedded pages are used to avoid repeated public pages. Just as we declare a public variable somewhere, therefore, it is not necessary to write the values represented by public variables everywhere, and it also brings convenience to the modification. It is actually equivalent to the master we use in ASP. NET.
Fourth, HTML pages (Views) directly support calling static or non-static methods provided in the background. In my opinion, it may have been hated by some people and I have been scolded by a classmate who does not know its name, but it must have been very useful. In the original aps.net, we didn't know what the front and back ends were, and then MVC appeared. Some people (most of them are just getting started, right ?) We have been clamoring for the separation of views and logic. Is separation absolute? In my opinion, the view must be separated from the business logic, but cannot be separated from the functional logic. The business logic here refers to various complex data processing to implement certain businesses, and the functional logic here refers to the logic processing to display data. Data Query is definitely not an aim. The real purpose is to display data. It's like a person who is lucky enough to have ten million pieces of data in his stomach and cannot show it. What's the use. I hope to display data in a simpler way, for example, a simpler cycle. For example, we can directly call the background Method for simple data processing, which has achieved a more perfect data presentation.
Fifth, reject a large number of configuration files. There is an idea that conventions are better than configurations. I have always thought that we need to configure too many SSH instances, even if we need to configure them even if they are trivial. Therefore, if it is not necessary for me to make a bold decision, I will try my best to avoid configuration files. For example, I will no longer host the action to spring. Instead of letting spring use the request scope to manage actions, it is better to let actions survive. anyway, even if it is hosted on spring, I have not seen the efficiency faster. The latest SSH supports configuration management using annotations, but I still don't think this is necessary. So in general, I use the common configuration for struts actions, and it makes everything easier. All of this is for us. I don't know what the situation looks like? Of course there are some other configurations, such as log4j, which can be simplified as well.
Sixth: limited use of model. Since the popularity of object-oriented technology, it has gradually become deeply rooted in the hearts of the people. The good and bad aspects also affect our judgment. The fixed mindset requires that we only identify the name and age columns based on the user ID. We also need to find a model list with 40 attributes. This is good or bad? We advocate the use of native SQL to query, fast and effective. Of course, when editing and saving, combined with the automatic binding function of struts2, model can improve the encoding efficiency. I am very cautious when using efficiency. This is only about coding efficiency or development efficiency. As for running efficiency, a series of binding translation operations, and finally executing SQL statements, is it always faster to directly execute SQL statements?
7. Reduce the conventional layering. I have never advocated the so-called three-tier architecture, multi-tier architecture, or even dozens of layers. Sometimes you only need to write 10 lines of code for the entire business logic, and you are forced to write a sentence of code at each layer. Khan, now free. I have never seen any architecture of tens of millions of projects so far. The largest project we have ever done is-. Our experience is that it is easy to develop, maintenance speed. So far, I have not met a customer who said: I am in a bad mood. replace your ms SQL statement with MySQL! So without considering the flexibility and configurability that has been so popular by some people, our framework becomes simpler and more flexible. Most of the designs I can see now are transitional designs. There is no need to build a factory to show off your design patterns! Simple is the best.
8. permissions and menus. I think there is no doubt that for a framework that is in use and can be used, no matter how layered it is, whether it is light or heavy, in any case, it must have its own menu and permission management policy. We have been doing some business systems, and permissions are life-saving. Lml provides corresponding interfaces to conveniently collect and generate permissions and menus. The specific business system can be managed based on the interface.
Ninth: Automatic paging. Inevitable paging leads to inevitable code. As an architect or a project manager, you can require programmers to handle paging logic on their own in each module. In most cases, the display can still be simply integrated. This is inappropriate. The pages used by lml do not need to be repeated. Whether it is a query condition, sorting, field display, or paging option, it can all be taken over with ease. What we need is this effect. Who else needs to keep writing pages.
10: Ajax support. Ajax has always been a mainstream technology. The bad news is that struts cannot directly access servlet APIs. The good news is that lml supports return JSON (""). In this way, Ajax is perfectly supported. You can also use return JavaScript () to output an executable script to the page. You may not know its greatness. We often use it to prompt the server to verify the result, instead of refreshing the page, it is not necessary to navigate to another page after verification.
I must be the author of the Framework. Let me talk about the advantages of the framework. I can talk about it all day and night.
However, this is not my purpose. In fact, my real purpose is to establish a simple and fast-looking style, so that some people can understand that for some needs, simple is the best.
Next set preview: Build and preview the framework.