So many open source frameworks, which is the best way to use it?

Source: Internet
Author: User

It must have been a question that we all have doubts about. I think most of the doubts are nothing more than the following points:

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

    2. Does this framework meet all of my needs? What if half of the use is found to be inappropriate?

    3. Does this frame have a high degree of coupling? Is it possible to customize the extension as needed?

Without first looking at the above, let us first say what kind of framework must not be adopted:

    1. Aggregation framework must give up (such as afinal,xutils), why? The more chatty, the easier it is to reaching, and in the framework world there is no 1+1>2 to say. The opposite readability is poor, coupled high, difficult to expand. Is afinal in the picture cache good or Fresco,picasso wait for good, self-evident?

    2. GitHub last commit more than a year or issues a large pile of no fix must not use. There will be a lot of pits, and if something goes wrong, you don't know who to ask. Accordingly, I most fear the question which others ask is: Stay, have you used the XXX frame? Take a look at the problem for me.

    3. Imitation xxx ui effect Daquan, please use carefully, if possible, more with the product manager to communicate, as far as possible using material design, in addition to reference instamaterial. Don't spend a lot of time and energy on adjusting the UI effect. UI performance and potential bugs are the most difficult to debug. Most people are smattering to touch events, view drawing.

Through the above conditions, the basic can pass off 60% of open source projects. Technical updates are fast, and many of the previously complex or fundamentally non-solvable requirements will have a good solution in the future. When you have not found the solution you want for a few days, it is advisable to do communication, choose other alternative needs.

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

Take a week to do your research. This is what kind of product, do a competitor analysis, consider the future may have the expansion. The optimal solution is to select the framework according to the product business. The overall project structure is very unlikely to be refactored in the future, so it is very painful to start with as much expansion as possible.

In addition, you can be assured of bold to try out the new open source LIB, any writing framework, all with simple and easy to use as the most fundamental purpose, with the advancement of Technology, the new framework will absorb the experience of predecessors and more mature. And the number of users is very small, there is a long transition period, you have enough time to verify that the framework is useful.

If your product is in the mature stage from 1 to N.

At this time, each frame replacement needs to be considered carefully, in the case of large user base, any bug will lead to serious consequences. As far as possible to use grayscale publishing, small-scale test and then unified upgrade.

For example, you think Universal-image-loader is not good enough, often oom, and download display speed is slow, then you can choose Fresco,picasso right. So, if you have not previously re-encapsulated the picture cache frame, try to encapsulate it as you change the frame. That is: Do not display the call Universalimageloader.display () or Fresco.display () in the code, because the code is called Too many places, once you want to change the frame, then change the place to fry the chicken more. For this to happen again later, you might as well wrap them up another layer. It's a little easier later. You said it right.

Or, IM messaging, now there are so many platforms of cloud push, how to choose is also a problem, if not sure, then before using to try to decouple and, do not explicitly call any cloud push API, self-packaging layer, so casually you how to change, do not need to change the business logic, Just use the Replace cloud Platform API to be OK.

As for the choice between similar frameworks, they are in fact similar, with some guidelines for reference only:

    1. If frame a relies on additional jars for more, careful use, learning is also a cost.

    2. If frame B does not have a detailed documentation, use caution, as in the case above.

    3. If frame C has a big impact on your current app, there are many changes, so use it sparingly.

    4. If frame d is highly coupled, it is not easy to extend and use sparingly.

Almost all these, open source lib too many, you mark of those Lib, can use on 10% is very good, can familiarize 1% of the source code and expand, also is a senior developer.

Said so much, as if nothing to say, why will write this article, is a classmate asked me how to choose.

If none of the above can be understood, then I'll just say what to use. My project almost all use their own framework, in addition to some UI will find Lib, can write their own basic self-made, after all, the structure of the perfect is also difficult to meet a specific demand.

The following pure recommendation, does not mean that I used, if there is a problem, do not come to me ha.

Network layer: Retrofit or volley+okhttp,async-http-lib try not to use, relatively old. In addition, these need to be further expanded, can be found on their own, useful integration into.
Database: Ormlite or realm, to encrypt the words with Sqlcipher
Picture cache: Fresco, Picasso, if the integrated effect is not ideal, see if the configuration parameters are correct
Tools: Check for memory leaks (leakcanary) asynchronous notifications (Rxjava use cautiously) mathematical expression (expression4j) Date processing (Joda time)

As for the Lib on the UI layer, I will not dwell on it.

Easier, have a problem with patience, before writing code to analyze more than Google, it is important to take the post-restructuring to the early stage.

So many open source frameworks, which is the best way to use it?

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.