DESIGN: some suggestions and suggestions for beginners of Java design and development (4)

Source: Internet
Author: User
Tags network function

Feiyun Xia http://www.jscud.com reprinted please indicate the author

[MVC, MVC2, web design and programming layering]

Please readArticleHttp://forum.javaeye.com/viewtopic.php? T = 11712 & postdays = 0 & postorder = ASC & START = 0

[Scalability is not equivalent to powerful functions. Do not exaggerate]

In today's systems, the use of interfaces or other methods is highly scalable, but not powerful.
An interface is very convenient for users to implement their own interfaces. However, if your system only implements one interface or is not implemented at all, it is not convenient for users.
 
For example, the validators of webwork is an interface, but in fact there are few specific classes and the functions are very poor. If you say that the webwork validator is very powerful, it may be inappropriate. of course, it is very convenient to extend the validator of webwork.
 
Of course, scalability is still needed, but don't brag. In this impetuous age, Let's do more things.

[20/80 principles]
 
In my work, I often think of the 20/80 principle, that is, the balec principle. For example, we can see that:

time: 20% of our time will produce 80% of the Results
product: 20% of the profits produced by 80% of the product
Read: 20% of the books cover 80% of the content.
Work: 20% of the work is satisfactory to us.
speech: 20% of speeches affected
leaders: 80% of the speakers made 20% of the decisions.

From the above we can see that it is often convincing.
 
Here I would like to mention a few points, but it may be different from the above starting point:
 
1.Program80% of customers are dealing with special situations. Therefore, we must pay attention to special situations, not special situations. 80% of customers pay attention to special situations.
The document should also be detailed in special cases, because developers are looking for these things 80% of the time, but seldom refer to the document for frequently used usage.

2. Optimization Problem: 80% of the bottlenecks are 20%CodeSo when optimizing the code, you don't need to optimize all the code. You only need to optimize the key code of 20%. Of course, we won't say much about the person who pursues perfection.
Remember that there is an optimization principle: "Don't optimize! Don't optimize ", it makes sense.

3. If you do 20% of things, it will often lead to 80% of things, or it will lead others to think that you have done almost all things.
If you give some very rigorous opinions on some things, others will think that you are not rigorous in other things.
Similar reasoning can be produced by such pushing, code quality, and document integrity.

(Of course, a person who writes a lot of code is often confused .)

 

 

[Force binding is not welcome]

Do not force some additional functions in the program.
 
Some frameworks often have many functions, such as "large computers". They have many functions, but when I need to type, I just need the typing function. Do not force me to use the network function, printing and load balancing functions.
 
In general, if one thing has many functions, it is well-configured and pluggable. In this way, it is unnecessary for users to use your things without using advanced functions, wasting users' memory and disks. it is not difficult for developers to copy a lot of LIB files, which takes up debugging time.
 
Don't buy one get one. Don't give it to me if you don't want it.
 

[Sometimes you have to consider compatibility]

Generally, there are many customers in a company, and the operating environments of users are various. jdk1.3, jdk1.4, and even jdk1.2. in this way, we must make some compromises during programming, and some function libraries cannot be used.
If the JDK of these users cannot be upgraded (generally, new products must be purchased to upgrade), or we must compromise on these situations, we should consider these issues during development.
 
For example, in servlet 2.2, we had to manually convert various characters because there was no setcharacterencoding. this function can be used when servlet2.3 is used. but for the sake of customers, we had to use the original method without upgrading. (Of course, most users later used the new app server, so we can use the filter to handle Encoding Problems ).
 
Downward compatibility is indeed a headache. jdk1.5 has been released for a long time, but we cannot use it now. We can only test it by ourselves.
 
When programming, you must set the IDE compatibility settings to prevent us from using unusable features. JBuilder and eclipse all have similar settings.
 
 

[Cost and reality give users a choice]

Full-text search: Lucene and like are three methods for retrieving large text fields. Which one do you use?
 
Maybe you will not hesitate to say "full-text search" (I think you are like TRS's support: P ).
 
As mentioned in "force binding is not welcome", I still feel that there is room for choice for users.
 
Full-text retrieval is costly or requires configuration. Generally, full-text retrieval for databases is not universal. Lucene is developed by developers, and only like is the simplest, but it is too simple and has poor performance.
 
At this time, we may have to provide several ways for users to choose from. Let's see how users choose them...
 
 
 
[Conclusion] 

There are still many other problems in the actual development and design. This article cannot discuss them one by one.
 
I hope you will become a high-level designer in development and design.
 

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.