'OSGi'에 해당되는 글 1건

OSGi 디자인

정보기술(IT) 2012. 10. 24. 12:01


문서출처 : http://www.osgi.org/blog/2006/04/details-are-important-when-you-are.html

 

당신은 어디에서 디자인을 시작할 것인가?  훌룡하게 잘 디자인되어진 OSGi는 무엇인가?

OSGi Framework은 컴포넌트를 위한 환경은 제공한다.

컴포넌트들로 디자인하는것은 주된 주류흐름이 아니고 확립된 규칙도 거의 없는 실정이다.

컴포넌트란 무엇인가?  OSGi 컴포넌트는 서비스를 통하여 기능을 공급하는 동적으로 전개될수 있는 단위이다. 보통 자바 인터페이스로 정의되어진다.

OGGi Log Component 예

이 번들이 시작되어지면 주변세계에 Log Service 와 Log Reader Service 를 공급한다.  다른 번들은  이 서비스를 얻어서 사용한다.

디자인 관점에서 그려보면 통신을 위해 포트를 가진 블랙박스로 컴포넌트로 다룰 수 있다.

UML에 표준모듈과 인터페이스 심볼이 존재한다는 것을 안다. 그러나 그들로는 결코 이룰수 없다.

나는 보통 번들로는 원을 ,서비스로는 삼각형을 사용한다.

서비스는 번들에 의해 3가지의 다른방식으로 사용되어 질수 있다.

1. Consumer – The bundle that gets the service is the consumer. The arrow from the bundle attaches to the horizontal or vertical line on a service triangle. An OSGi service can be consumed many times by any bundle. Many bundles can therefore connect to the horizontal or vertical line of the triangle.
2. Implementer – The bundle that implements the service must register it. This is depicted by drawing a line to a corner of the triangle. An OSGi service can be registered many times by the same or different bundles.
3. Listener – A listener bundle connects to one of the angled lines of the triangle. A listener is notified of registrations, modifications and unregistrations of the service. A service can have many listeners.


None of the bundles has a dependency on any of the other bundles. I might bore you, but I can not stress enough how important this concept is!


The whiteboard pattern is an example of inversion of control (IoC). That is: “Do not call us, we will call you”.

If you need something from the world or have something useful functionality to offer to the world, register a service and wait till somebody calls you.

The best litmus test for a service is: “Do I decrease coupling”?

블로그 이미지

희망잡이

,