SystemOrganization 딕셔너리에 대한 심화학습

이렇게 제목을 적으면 뭐 있을거같지만…없어요…-.-;

SystemOrganization 딕셔너리는 Smalltalk에서 Class들과 package등에 대한 구조를 담고있다고 합니다.

아 궁금하네요?

Inspect It 해봤죠.

SystemOrganization inspect
SystemOrganization inspect

 

어머? 뭔가 디게 많네요?……………………

http://trans.onionmixer.net/mediawiki/index.php?title=SqueakByExample:5.7#.EB.8B.A4.EB.A5.B8_.EC.9C.A0.EC.9A.A9.ED.95.9C_.EC.A0.84.EC.97.AD_.EB.B3.80.EC.88.98.EB.93.A4

이 부분을 보면 Magnitude가 어느 Collection에 속해있는지를 찾는법이 나옵니다.

아.. 궁금하네요 어떻게 찾는지?

 

SystemOrganization의 클래스를 찾으면 SystemOrganizer가 나오구요

여기서 method인 categoryOfElement: 를 찾으니깐 없네요? 그럼 누군가는 가지고 있겠죠… 자 그럼 부모클래스로 가보죠.

오호.. Categorizer 라는 클래스가 나오고 이 클래스의 셀렉터중에 categoryOfElement: 가 있습니다.

categoryOfElement: element
"Answer the category associated with the argument, element."

| index |
  index := self numberOfCategoryOfElement: element.
  index = 0
  ifTrue: [^nil]
  ifFalse: [^categoryArray at: index]

대략 이정도의 의미를 알 수가 있군요.

뭐.. 그럭저럭… 가지고 있는 categoryArray라는 인스턴스변수배역에서 관련된 값을 끄집어내는거같습니다.

변수를 본다고 제가 알 수 있는건 아니니.. 이쯤에서 pass욤 😀