Refactoring method 37: Remove control flag (remove control flag)

  In a series of boolean expressions, a variable carries a "control flag.Replace the control mark with a break or return statement. Motivation: In a series of conditional expressions, you will often see the control mark used to determine when to

Bad code 02: Long Method)

90% , to reduce the function size, you only need to use extract method (extraction function) find the part of the function that is suitable for aggregation, extract them to form new functions. If a function contains a large number of

Bad code taste 19: imperfect Library Class)

Reuse is often regarded as the ultimate goal of objects. However, the significance of reuse is often overestimated: Most objects only need to be enough. But it is undeniable that many programming technologies are built onProgramLibrary. Database

Bad code: 20: pure data class)

The so-calledData classThey have some fields and functions used to access these fields. Such classes are just data containers that do not speak, and they must be controlled by other classes excessively. These classes may havePublicFields, so you

Reconstruction Method 19: replace data value with object (replace data value with object)

  You have a data item that must be used together with other data and actions to make sense.Convert data items into objects. Motivation: at the initial stage of development, you often decide to use simple data items to indicate simple situations.

Refactoring Method 40: Introduce Null Object (introducing null objects)

You need to check whether an object is null again and again.Replace null with a null object. Motivation: the most fundamental benefit of polymorphism is that you don't have to ask the object "What type are you?" and then call a behavior of the

Bad code taste 21: rejected bequest)

Subclass should inherit the functions and data of superclasses. But what if they don't want to or do not need inheritance? They get all the gifts, but they just pick a few of them to play. Traditionally, this means that the design of the

Use iformatprovider to create your own personalized formatting Method

C # provides a lot of formatting methods for numbers or strings. However, in project development, there are many formats that cannot be implemented as needed, so we need to define iformatprovider, which is actually very simple, you only need to

Reconstruction Method 57: Pull up field (Field Moving up)

2Child classes have the same fields.Move this field to the superclass. Motivation: if each subclass is developed separately or combined during the refactoring process, you will often find that they have repeated features, especially fields that

Learning XSLT (1)

I don't know much about the theory. Let's take an example for a preliminary introduction! Sorry! Thank you for your comments! First read an XML document XML Code highlighting produced by Actipro CodeHighlighter

Bad code 13: speculative generality)

If an abstract class does not really work, use collapse Hierarch (collapse inheritance system) . You can use inline class (to link classes) for unnecessary delegation) remove. If some parameters of the function are not used, you can remove

Reconstruction Method 52: Hide method (hidden function)

There is a function that has never been used by any other class.Modify this function to private. Motivation: refactoring often prompts you to modify the visibility of a function. It is easy to imagine that another class needs to use a function, so

Refactoring Method 28: encapsulated collection (encapsulation set)

  A function returns a set.Let this function return a read-only copy of the set and provide a function to add/remove the element of the set in this class. Motivation: we often use a set in a class to store a group of instances. Such classes also

Reconstruction Method 49: replace parameter with methods (replace parameters with functions)

The object calls a function and passes the result as a parameter to another function. The function that accepts this parameter can also call the previous function.Let the parameter receiver remove this parameter and directly call the previous

Flex-mouse style settings

Flex itself has poor support for mouse styles, so if you want a better mouse experience, you need to customize your mouse styles. Flex supports three types of mouse styles: Normal, manual, and busy. You can set the parameters in the following

The row title of the datagridview.

The rows of the datagridview rocontains A headercell which can be used to set the row title text. However, after sorting, the text is cleared. therefore, this method is not feasible. next I will introduce a new method .. that is, when the

Flash as3 WebService

Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> Mywebservice. As Package {Import flash.net.*;Import flash. Events.*; Public ClassMywebservice extends eventdispatcher { PrivateVaR wsurl:

Refactoring method 06: Split temporary variable (break down temporary variables)

  YourProgramA temporary variable is assigned more than once. It is neither a cyclic variable nor used to collect computing results.Creates an independent temporary variable for each assignment. DoubleTemp = 2 + (_ height + _ width );

Basic Introduction to Web Control Development Series (-)

Controls are often used in Web development. Although some of them already exist in the toolbox, sometimes they need to be developed according to their own requirements.Suitable for your own controls. Web control development has become a

Reconstruction Method 59: Pull up constructor body (constructor ontology moving up)

You have some constructors in each subclass, and their ontology is almost identical.Create a new constructor in the superclass and call it in the subclass constructor. Motivation: constructor is a wonderful thing. They are not common functions, and

Total Pages: 64722 1 .... 54558 54559 54560 54561 54562 .... 64722 Go to: GO

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.