Source Code Refactoring: Difference between revisions
Wolfganguhr (talk | contribs) |
Wolfganguhr (talk | contribs) |
||
Line 24: | Line 24: | ||
[[File:Reference-structure-partner-ui.JPG]] | [[File:Reference-structure-partner-ui.JPG]] | ||
Here the Assembly Ict.Petra.Server.lib.MPartner uses the assmbly Ict.Petra.Server.lib.MPartner.ui. You can easily find the reason for this, if you delete the ui-reference in Ict.Petra.Server.lib.MPartner and recompile. Then you are asked to remove a set of "using Ict.Petra.Server.MPartner.Extracts.UIConnectors;" lines and you can recompile again. Then you get a list of errors like "Missing TPartnerEditUIConnector" and then you have to realize that you have to move the code from Ict.Petra.Server.lib.MPartner to Ict.Petra.Server.lib.MPartner.ui. | Here the Assembly Ict.Petra.Server.lib.MPartner uses the assmbly Ict.Petra.Server.lib.MPartner.ui. You can easily find the reason for this, if you delete the ui-reference in Ict.Petra.Server.lib.MPartner and recompile. Then you are asked to remove a set of "using Ict.Petra.Server.MPartner.Extracts.UIConnectors;" lines and you can recompile again. Then you get a list of errors like "Missing TPartnerEditUIConnector" and then you have to realize that you have to move the code from Ict.Petra.Server.lib.MPartner to Ict.Petra.Server.lib.MPartner.ui. The final goal is to move the connector to the top. | ||
[[File:Reference-structure-partner-ui.JPG]] |
Revision as of 07:22, 19 Mayıs 2011
Motivation
A set of cyclic reference errors enforced to run a specific type of source code refactoring. In order to understand this we have a small diagram like this:
Here the assembly dependencies are shown i.e. which assemblie use which other assembly. The details of this diagram are not so important at this point. Actually it is more important to understand that there exists a dependecy structure and how to handle it.
Tools to investigate the dependencies
Actually I've used some additional tools
- the red gate reflector and
- a .NET Reflector Add-Ins named Graph
- this addin need the programm Microsoft Glee which now has become a commercial tool named "Microsoft Automatic Graph Layout (MSAGL)". The cost free version is availiable by refering the link and will work well.
Install this tools check out the sources, run "nant generateSolution" and you can load the dlls to investigate the reference structure. On the other side I have the Enterprise Architect and for this program exists an plug in too RizoSuite. But it seems that it needs a higher level of EA.
Detailed Problems
Le us have a look onto the special dependency:
Here the Assembly Ict.Petra.Server.lib.MPartner uses the assmbly Ict.Petra.Server.lib.MPartner.ui. You can easily find the reason for this, if you delete the ui-reference in Ict.Petra.Server.lib.MPartner and recompile. Then you are asked to remove a set of "using Ict.Petra.Server.MPartner.Extracts.UIConnectors;" lines and you can recompile again. Then you get a list of errors like "Missing TPartnerEditUIConnector" and then you have to realize that you have to move the code from Ict.Petra.Server.lib.MPartner to Ict.Petra.Server.lib.MPartner.ui. The final goal is to move the connector to the top.