Thoughts on software reusability

Source: Internet
Author: User
Software reusability has always been one of the goals of software engineering. Software Engineering hopes to quickly build specific application systems using standardized software modules like other industrial fields one day. In fact, this kind of effort has also made considerable progress, but there are still many gaps with people's expectations, the software module is far from convenient and simple to disassemble, maintain, and replace as the tires on a car.

Software reusability discussed in most cases refers to the reusability of the software itself, that is, the reusability of software code implementation. In fact, the reusability of software is far more than that. the entire life cycle of software development has the value of reusability, including project organization, software requirements, design, documentation, implementation, testing methods, and test cases are all effective resources that can be reused or used for reference. It can be said that the whole process of a successful software project is treasure, and it depends on whether you will use it.

Of course, software code reusability is the most intuitive and easy to think of, and is also the part that programmers are most willing to pursue and have a sense of accomplishment. But how can we develop reusable code?

Some programmers may say: this is very easy. I have encapsulated many classes with C ++. I have developed many COM components with Visual Studio. Isn't it all reusable? Is that true? As far as I know and have experienced many software development projects, many types and components are flash in the sky, and no one will mention them once the project is over. Many Programmers think that classes or COM components developed using C ++ should naturally be reusable. This is a wrong idea. development tools are just tools that promote code reusability rather than decisive factors, the key to determining whether code can be reused is the decomposition method of the problem domain oriented to the software system, which breaks down a complex problem into simple problems or independent methods and strategies. I have always been convinced that when a programmer uses C, it is not good to use modular structures to construct a software system, you cannot expect C ++ to write highly reusable class structures. It is not a development tool that determines the reusability of the software, but how to resolve a complex problem. Whether it is a hierarchical software idea (TCP/IP protocol stack), a modular software idea (C/Fortran), or a reusable component software idea (C ++/COM ), they are not contradictions and exclusion, but three aspects of a problem. They are different perspectives on the same problem domain.

  

Some programmers may say that the software we develop is based on specific user requirements and has different requirements. There is no way to reuse the software. It sounds reasonable. In fact, software reusability is also applicable. Of course, it cannot be expected that many programmers can develop universal software modules, maybe some programmers will never develop such software. Isn't the reusability of the software irrelevant to him? Of course not. reusability is reflected in all layers of software. General software modules with high reusability are often provided by operating systems or development tools, for example, general libraries, standard components, and standard template libraries do not need to be re-developed by programmers. So how do programmers develop reusable software? Under normal circumstances, a software enterprise or software group tends to focus on solving problems in a certain field. Although software projects in this field are not exactly the same, there are many commonalities, for example, most software in the finance or ERP field requires a variety of customized tables and charts. Therefore, when developing software, developing reusable software for a specific domain or problem domain is a major concern and direction for most programmers.

  

So in the actual development process, how can programmers improve their ability to develop reusable software? I have a few small suggestions that may help you.

  Establish the awareness of developing reusable software:

First, establish the awareness of developing reusable software. No matter how special the software you are developing is, it must contain some public logic and functions, separates common logic or modules from specific logic, and learns to abstract several logical layers from a specific question to implement them separately. Reusable Software modules are used as a by-product of a specific software product to repeat the light.

  Keep the simplicity and purity of classes or modules:

Keep the simplicity and purity of classes or modules. The simpler the software and the more pure the functionality it is, the more likely it will be reused. "The simpler it is, the more complicated it is." Just like building blocks, the simpler the provided blocks are, the more likely they are to build complex shapes and items.

Maybe one day, one of your colleagues said to you, "Hey, buddy, I just used the module you developed in the previous project. It's pretty good ". You have implemented reusable software.

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.