astah*

Japanese | English
Home 機能 C#リバース 対応項目の詳細

お知らせ

[pro,UML] C#リバース 対応項目の詳細

Eメール 印刷

ここでは astah* の編集APIを利用したサンプル「C#リバースプログラム」を解説します。
本アプリケーションを用いて、C#ソースコードから astah*モデルを作成できます。


未対応の項目

現在、次の項目は未対応のためリバースできません。

  • abstract
  • attribute
  • extern
  • partial
  • 英語以外(例:日本語)を含むクラス、属性、操作等(doxygen1.5.7以降で解消済み)
  • 英語以外(例:日本語)のパスを含む *.cs

対応項目の詳細

  • クラス、属性、操作、それらの各定義、astah* professional、astah* UMLが対応するC#の言語属性の取込みに対応しています。
  • [バージョン 6.3以降] Systemパッケージに含まれないクラス、テンプレートを持つコレクションクラスの場合(System::Collections::Generic::ICollection<Child>, System::Collections::Generic::IList<Child>, System::Collections::Generic::ISet<Child>, System::Collections::Generic::HashSet<Child>,System::Collections::Generic::SortedSet<Child>, System::Collections::Generic::Queue<Child>, System::Collections::Generic::Stack<Child>,System::Collections::Generic::IDictionary<string, Child>, System::Collections::Generic::Dictionary<string, Child>)は関連として出力され限定子、制約({ordered},{unique})、多重度を設定するように改善しました。(【本プログラムの設定 - Config.propertiesファイル】のjude_csharp_types_for_attributeより優先されます。)
ソースコード(親クラスの属性のタイプ) 親関連端の限定子 子関連端 多重度 制約
System::Collections::Generic::ICollection<Child> なし Child * なし
System::Collections::Generic::IList<Child> なし Child * {ordered}
System::Collections::Generic::ISet<Child> なし Child * {unique}
System::Collections::Generic::HashSet<Child> なし Child * {unique}
System::Collections::Generic::SortedSet<Child> なし Child * {ordered},{unique}
System::Collections::Generic::Queue<Child> なし Child * {ordered}
System::Collections::Generic::Stack<Child> なし Child * {ordered}
System::Collections::Generic::IDictionary<string,Child> key:string Child なし なし
System::Collections::Generic::Dictionary<string,Child> key:string Child なし なし
ユーザー定義テンプレートクラス<Child> なし ユーザー定義テンプレートクラス<Child> なし なし
System::Collections::Generic::List<Child> なし Child * {ordered}
ユーザー定義クラス[] なし ユーザー定義クラス * なし

 

デフォルトモデル astah* professional(astah* UML)インストールフォルダ\template\project\C_Sharp.astaをデフォルトモデルとして読み込みます。このファイルがない場合、デ フォルトモデルを読み込みません。C_Sharp.astaはastah* professional(astah* UML)インストール時に配備され、System配下の主要なクラスを含みます。
プリミティブ型 プリミティブ型としてリバース
const [属性] 言語タブのconst
delegate [クラス] 言語タブのdelegate
~destructor() 操作(名前: ~から始まる名前、戻り型: " ")
enum
  • [クラス] ステレオタイプタブの <<enum>>
  • [属性] ステレオタイプタブの <<enum constant>>
event

[操作] 言語タブの<<event>>
例) public class EventList { public event NameListHandler nameListEvent; }

  • 名前: "nameListEvent"
  • 型: "NameListEventHandler"
  • <<event>>: "true"の操作
event:add

addを持つeventは、Doxygenでpropertyに変換される
例) public class EventList { public event void operation2 { add { operation2 += value; } } }

  • 名前: "operation2"
  • 型: "void"
  • <<property>>: "true"
  • <<property>>get: "true"
  • <<property>>set: "true"の操作
event:remove
removeを持つeventは、Doxygenでpropertyに変換される
例)public class EventList { public event void operation2 { remove { operation2 -= value; } } }
  • 名前: "operation2"
  • 型: "void"
  • <<property>>: "true"
  • <<property>>get: "true"
  • <<property>>set: "true"の操作
generics

[クラス] テンプレートパラメタタブ
[Doxygen 1.5.6まで]

  • "class Class0<T>" はOK
  • "class Class0<T> where T:Class1" は、Doxygenでスキップされるため未対応

[Doxygen 1.5.7以降]

  • "class Class0<T>"はクラス"Class0"にテンプレートパラメタ"T"が追加される。"T"の型は"<<Unspecified>>"になる。
  • "class Class0<T> where T:Class1"はクラス"Class0"にテンプレートパラメタ"T"が追加される。"T"の型は"Class1"にならず"<<Unspecified>>"になる
indexer [操作] 言語タブの <<indexer>>
Doxygenでは、一つのクラスに同名で同型のindexerが複数ある場合、二つ目以降はスキップされる
indexer:get
[操作] 言語タブの<<indexer>>:get
indexer:set [操作] 言語タブの<<indexer>>:set
internal
[クラス] 未対応、[属性] 言語タブのinternal、[操作] 言語タブのinternal
inout [操作] パラメタタブの方向種別
override
[操作] 言語タブのoverride
property [属性] 言語タブの<<property>>
property:get [属性] 言語タブの<<property>>:get
property:set [属性] 言語タブの<<property>>:set
readonly
[属性] 言語タブのreadonly
sealed
[クラス] 言語タブのsealed、[操作] 言語タブのsealed
static [クラス] 言語タブのstatic、[属性] ベースタブのStatic、[操作] ベースタブのStatic
struct [クラス] 言語タブの<<struct>>
unsafe [クラス] 言語タブのunsafe
virtual [クラス] 言語タブのvirtual
volatile [属性] 言語タブのvolatile
Doxygenでは、"volatile int variable;"は volatileにならないが、"const volatile int variable;" はvolatileになる
汎化・実現 [クラス] 汎化・依存タブ
Doxygenでは、"class Class0: ClassWithSrc{}(ClassWithSrcのソース有)" は ClassWithSrcからClass0に汎化が追加されるが、"class Class1: ClassWithoutSrc{}(ClassWithoutSrcのソース無)" は ClassWithoutSrcクラス自体取り込まれない。
extension_method [操作] 言語タブのextension_method