Genius DM

Quick Diagram Tool for C# 본문

Dev Tool

Quick Diagram Tool for C#

Damon Jung 2018. 7. 28. 09:46

Quick Diagram Tool For C#


Visualstudio Extension 툴 하나를 소개할까 한다. Code visualization 툴 중의 하나인데, Framework 분석할 때, 상속 관계를 한 눈에 보고 싶을 때 사용하기 간편해서 애용하는 편이다.



설치

Visualstudio 상단에 도구를 클릭하면 확장 및 업데이트(U) 메뉴가 나온다. 그것을 누르자.





검색을 Quick diagram 으로 검색하면, Quick diagram tool for C# 이 보일 것이다. 그것을 설치한다.







사용하기

이제 상속관계를 조사하고 싶은 Class, Interface 등의 개체를 우클릭하면 툴팁 메뉴 최하단에 

    • Add to Quick Diagram
    • Add to Quick Diagram With Hierarchy

항목이 생긴다. With Hierarchy 옵션을 누르면




아래처럼 렌더링이 시작된다.








결과 화면이다. 박스에 ● 이런 점이 붙어있다면, "어떠한 관계가 존재한다는 의미" 이다.







박스를 확대해서 보면 5가지 Interaction 요소가 있다. X 는 Diagram 삭제이므로 설명을 생략한다.



1. 마우스 툴팁. Full Namespace 와 개체의 명칭을 보여준다.





2. Base Types. 좌측 상단의 화살표인데, Base types 를 추적해준다.






3. Implemented interfaces. 해당 개체가 구현한 인터페이스를 보여준다.








4. Derived types. 해당 개체로부터 파생된 개체를 추적해준다.







5. Implementing types. 인터페이스를 구현하는 개체를 추적해준다.








이제 활성화된 Implementing types 를 클릭하면, 아래 처럼 IScopeStore 인터페이스를 구현하는 객체들을 리스팅해준다.







저 항목들을 클릭해주면, 아래와 같이 Diagram 과 화살표로 관계를 그려준다.







InMemoryScopeStore Diagram 항목을 더블클릭하면 코드 네비게이션까지 알아서 해준다.







아래는 IEnumerable 인터페이스 관계를 하위 객체 일부만 선택해서 본 것인데, 아래와 같이 무한대로 정렬된다.








인터페이스와 Base 클래스 파악하는 데는 최고

모든 어플리케이션에서 인터페이스와 Base 클래스가 뿌리가 되는 요소이므로, 분석을 수행함에있어 가장 첫번째로 파악해야 하는 것이 이 두 요소라고 생각한다. " : IEmptyInterface " 따위의 상속 또는 구현 콜론 키워드로 검색해서 VisualStudio 상의 검색 결과 창에서 볼 수도 있지만, 시각적으로 계층구조와 함께 바라보는 것, 그리고 탐색된 객체가 또 다른 어떤 것을 상속하는지, 해당 객체에 대한 하위 파생 클래스는 또 없는지를 한 화면에서 한 눈에 볼 수 있기 때문에 분석이 빨라진다. ( 약간의 재미도 있고... )




Private Network 에서 사용하려면

Visual Studio Marketplace 에서 직접 vsix 파일을 다운로드 할 수 있다.


























Quick Diagram Tool For C#


I'm going to introduce an efficient Visualstudio extension tool, Quick Diagram Tool For C#; one of the code visualization tools out there. It's a light weight, easy to use utility for analyzing a framework and displaying the hierarchical structure of objects.



Installation

Click the 도구 ( Tool ) on top of the IDE and then you can see 확장 및 업데이트(U) ( extensions and update ). Click it.





Type Quick Diagram and search for it. You're gonna see Quick diagram tool for C# within a sec. Let's have it installed.







How to use

Rightclick on a class or an interface, whatever that you want to inspect.

    • Add to Quick Diagram
    • Add to Quick Diagram With Hierarchy

Then two articles above shows up at the bottom of the tooltip menu. Click ~ With Hierarchy one.





Then rendering goes on.








This is a result sheet. You can see the dot ● at the edge of the diagram box, that means it has some relations.







Zoom in and you will notice five interfaction elements in the box. The red X is for removing the box from the sheet, so please mercy me stating the obvious.



1. When you hover your mouse, a tooltip will be displayed. It shows the full namespace and the object's name.






2. Base types. It's the arrow on the left at the top, it tracks down this object's base types.







3. Implemented interfaces. It shows the interfaces this object is implementing.







4. Derived types. It's the arrow on the left at the bottom, it tracks down the derived types of this object.








5. Implementing types. It tracks down the implementing classes for this interface.







Now if you click on the implementing types arrow, it lists up the classes that implement this interface.






Click those listed items, then this tool renders those two like this below.







doubleclick on InMemoryScopeStore Diagram item automatically navigate you to the code.






This is sample hierarchical diagrams for IEnumerable. It's infinitely lined up like this.







Best for analyzing interfaces and base types

Interface and base type are the root elements of all applications, in most cases. I think these two elements are the first thing you should look into IMAO. You can just type : IEmptyInterface " this kind of things in the built-in search box in Visualstudio and see the results in the search result box but this is extremely readable with all the colors. boxes. arrows, and hierarchical structures. And you can get to know the relationships with another objects very easily by just hovering your mouse and clicking the box a few times. Plus, it's way more fun than searching.




To use in private network enviroment.

You can directly download vsix offline installer at Visual Studio Marketplace.



















'Dev Tool' 카테고리의 다른 글

Swagger CodeGen 을 이용한 JMeter Project 만들기  (0) 2018.05.08
Comments