Monday 26 March 2012

Moncler Men JacketsCouplingdegree

Couplingdegree ,what is the degree of coupling software design usually coupling and cohesion as a measure of the module is independent of the degree of standard .Partition block touch a guideline is low coupling .
Coupling degree (Coupling ) is a measure of the degree of association between modules .The coupling strength depends on the module interface complexity ,call module and transmitting data through interface number .
Die block coupling degree between refers to the dependencies among the modules ,including the control relationship ,call ,Moncler Men Jackets,data transmission between .Inter module contact more, the coupling is stronger ,while demonstrating their independence worse .
To reduce the coupling between modules can reduce module effects, to prevent a module is modified by interlinked ripple effect ,guarantee system design smoothly .Inner poly and the coupling with other modules are closely related ,there is a strong coupling between modules often means that weakly cohesive ,strong cohesion often means a weak coupling .
Coupling degree is a module ( class ) and other modules ( class ) ,the association between perceived and the dependence of the level ,is a measure of the code independence as an indicator ,but also software engineering design and coding quality evaluation of a standard .
The coupling strength depends on the following factors :( 1) a module to another module call; ( 2) a module to another module transmission data amount ;( 3) a module is applied to another module control number ;( 4) between the complex interface module degree .
Coupling as from strong to weak sequence can be divided into the following types :a ) direct coupling between two modules :no direct relationship ,connection between entirely through the main control module and calls to achieve B ) data coupling :a module access to another module ,each other by simple data exchange input ,output information .
Here a simple data parameters differed from the control parameters ,public data structures or external variables .C ) coupled to a tag :as a set of modules through a parameter table transfer record information ,is coupled to a tag .
This record is a data structure of the substructure, is not a simple variable .D ) control coupling: a module through a transfer switch ,logo ,name and other control information ,clear control to choose another module function E ) external coupling :a set of modules are accessing the same global simple variable rather than a global data structure, but not through the parameter transfer the information of global variables f ) public coupling :a group of modules are accessed with a few public according to the environment .
The public data environment is a global data structure ,a shared communication zone ,memory of public coverage area .G ) content coupling :a module directly modify another module data ,or directly to another module cohesion refers to the elements within the links between the close degree, module cohesion species usually can be divided into 7 kinds, according to their cohesion from low to high order by :coincidental cohesion ,logical cohesion ,cohesion ,cohesion ,instantaneous communication process ,sequential cohesion ,functional cohesion cohesion .
Two ,why low coupling to understand what is coupled and coupling classification ,I think everyone to why wanting to reduce coupling degree have a certain understanding ,and the majority of developers also probably tasted hardships caused by head high coupling .
The reason is very simple ,the coupling degree is high, the maintenance of code to modify a place could be implicated in many places ,if the modification did not disentangle the coupling relations, then the consequences would be disastrous ,especially to demand changes is more and more collaborative development maintenance project ,modifying a place will cause the already stable module error ,will lead to serious vicious spiral ,never to be no end ,developed and tested in various problems between running hard, finally led to the project ,user satisfaction, reduce cost ,increase of users and developers ,this influence is very abominable ,various risk is self-evident the .
In order to prevent the occurrence of these problems ,one of the important means is to reduce code coupling degree .But also not be absolutely zero coupling ,such as based on the J2EE programming it must be coupled with JDK ,and high coupling is not nothing is right.
If ,during early stages of design that a functional late basic need not be amended, so even if the high coupling was also not .However ,in the absence of the ability to design the basic need to modify the code before ,also called low coupling as the standard .
So how can we minimize the coupling degree ?The following describes several methods of reducing coupling degree .Three ,reduce the coupling degree of method 1 ,less use of the inheritance ,multiple interfaces hiding implementation details .
Java object-oriented programming interface in addition to introduce support polymorphism ,hiding implementation details are one purpose .2 ,module function of the single word as far as possible ,is also very simple ,single function modules for other modules will have less opportunity to .
(this is actually high cohesion of a claim ,low coupling generally occur at the same time, in order to limit of space ,we will at a later edition midterm discussion ) .In 3 ,according to a defined in only one place .
4 ,less use of global variables .In 5 ,the attributes and methods of a class declaration to use less public ,use private key ,Beats By Dr. Dre,6 ,use of design patterns ,such as using the MVC design pattern can reduce the interface and business logic in the coupling degree .
7 ,try not to use hard coded way to write programs ,but also try to avoid the direct operation of the database using SQL statement .In 8 ,the final course is to avoid direct manipulation or call other module or class ( content coupling ) ;if the module must be between the coupling exists ,try to use data coupling principle ,use less control coupling ,the limits of public coupling range ,avoid the use of content coupling .
This indicates that the internal cohesion :named ,aggregation ,correlation length ,then the high cohesion is being highly aggregation and association .High cohesion :between classes depending on the relationship ,high ,meaning the relationship between them should be simple ,clear ,do not have a strong relationship ,otherwise ,the problem would be to run up .
A class of operation effect to other classes .Due to the high cohesion with robustness ,reliability ,reusability ,readability and other advantages ,module design is recommended to use high cohesion .
This is the software engineering concept ,was judged good or bad design standards ,mainly for the OO design ,mainly to see whether the high class cohesion ,coupling degree is low high cohesion ,low coupling ,first of all to know a software is composed of a number of subroutines and assembled ,and a program by multiple modules ( method ) .
!high cohesion ,Cheap Coach,low coupling is mainly the description of object oriented system, each class requires the separation of duty thought .Each class to complete a specific function independently, this is the high cohesion .
Coupling is a class among the call ,if the coupling is strong ,involve each call a lot ,so will be far-reaching, is not conducive to maintenance and expansion .Between class settings should be low coupling ,Coach Store,but each class should have high cohesion.
Coupling is the interdependence between the scales. If every object has references to other objects ,then has the high coupling ,it is not desirable ,Moncler Sale,because between two objects ,potential flow too much information .
The lower coupling is required :it means that the object between independent work .Low coupling minimizes change for a class and resulted in changes to the other class " chain reaction ;" ;.
Cohesion is a class of variables and the method of connecting intensity scale. High cohesion is & # was 20540 ;want ,because it means that the class can be better to perform a job. Low cohesion is not good ,because it shows that the class of elements between rarely associated .
Between elements are associated with the module is in line with the requirements .Each method should also be high cohesion. Most methods to perform only one function. Not in method of adding instruction ,this will result in a method to perform more functions .
Related articles:

No comments:

Post a Comment