Which of the following is a good choice for so many open-source frameworks ?, So many open-source frameworks

Source: Internet
Author: User

Which of the following is a good choice for so many open-source frameworks ?, So many open-source frameworks

You may have doubts about such a problem. Most of my questions are as follows:

  1. Is this framework stable? What if there is a bug?

  2. Can this framework meet all my needs? What should I do if I find that half of them are not applicable?

  3. Is this framework highly coupled? Can I customize expansion as needed?

 

First, let's not look at the above points. First, let's say what kind of framework must not be adopted:

  1. The aggregate framework must be abandoned (such as Afinal, xUtils), why? The bigger and more comprehensive, the easier it will be to trigger the whole body, and there is no 1 + 1> 2 in the framework world. On the contrary, it has poor readability, high coupling, and is difficult to expand. Is the image cache in Afinal good, like fresco and Picasso, self-evident?

  2. The last commit on github is more than a year or a lot of issues without a fix must not be used. There will be many pitfalls. If something goes wrong, you don't know who to ask. Correspondingly, the most feared question is: Stay. Have you used the xxx framework? Let me take a look at this problem ..

  3. Complete the effect of the imitation xxx UI, please use it with caution. If you can, communicate with the product manager and try to use the Material Design. In addition, you can refer to InstaMaterial. Don't spend a lot of time and effort on the UI effect. UI performance and potential bugs are the most difficult to debug. Most people know nothing about touch events and view rendering.

 

By using the above conditions, you can basically pass out 60% of open-source projects. The technology is still very fast, and many previously complicated or unsolvable needs can have good solutions in the future. When you haven't found the solution you want for a few days, you may wish to communicate and choose other alternative requirements.

If your project is in the initial phase from 0 to 1.

It may take a week to do research. What kind of product is this? Do the analysis of competing products and consider the possible expansion in the future. Selecting a framework based on the product business is the optimal solution. The overall project structure is unlikely to be reconstructed in the future, so we should consider expansion as much as possible at the beginning, otherwise it would be very painful.

In addition, you can try out the new open-source lib with peace of mind. Whenever you write a framework, it is designed to be simple and easy to use. With the advancement of technology, the new framework will also absorb the experience of our predecessors and become more and more mature. In addition, the number of users is small, and there is still a long transitional period in the early stage. You have enough time to verify whether the framework is useful.

If your product is mature from 1 to N.

At this time, every framework should be replaced with caution. When the user base is large, any bug will cause serious consequences. Use phased release as much as possible, and upgrade after small-scale tests.

For example, if you think that the universal-image-loader is not easy to use, usually oom, And the download speed is slow, you can choose fresco or picasso. If you have not previously re-encapsulated the image cache framework, try to encapsulate it when you change the framework. That is, do not call UniversalImageLoader shown in the code. display () or fresco. display (), because the code is called too many places. Once you want to change the framework, there will be more places to change. To avoid such problems in the future, you may wish to package them again. It will be easier in the future. You are right.

In other words, the choice of cloud push on so many platforms for sending and receiving IM messages is also a problem. If you are not sure about it, try to decouple it before using it, do not explicitly call any cloud push API and pack it again. In this way, you do not need to change the business logic, but simply replace the cloud platform API.

As for how to choose between similar frameworks, there are actually similar rules for reference only:

  1. If framework A relies heavily on other jar files and is used with caution, learning is also costly.

  2. If framework B does not have detailed documentation, use it with caution for the same reason.

  3. If framework C has a great impact on your current App and there are many changes, use it with caution.

  4. If the framework D has a high Coupling Degree and is not easy to expand, use it with caution.

Similar to that, there are too many open-source lib. The lib you mark can use 10% is very good. It is also a senior developer who can read and expand the source code of 1%.

After talking so much, it seems that I did not talk about anything. Why did I write this article? Some people asked me how to choose it.

If none of the above can be understood, I will simply say what should be used. Almost all my projects use self-written frameworks. Apart from some UIS, I can find lib and write my own framework. After all, it is difficult to meet a specific requirement if the architecture is improved.

The following pure recommendations do not mean I have used them. If something goes wrong, don't bother me.

Network Layer: suitable fit, Volley + OkHttp, async-http-lib should be used as far as possible, relatively old. In addition, these need to be further extended. You can search for them and integrate them if they are useful.
Database: Ormlite or Realm. to encrypt the database, use SqlCipher
Image cache: Fresco and Picasso. If the integration effect is not satisfactory, check whether the configuration parameters are correct.
Tool: leakcanary asynchronous notification (RxJava is used with caution) mathematical expression (expression4j) Date Processing (joda time)

I will not elaborate on the lib of the UI Layer. I will search for it by myself.

It is difficult to know how to handle problems and be patient. before writing code, you must analyze google more. Therefore, you must rebuild your code later.

 

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.