Do diffence

Eclipse Galileo Feature Top 10 List, Number 2 본문

OLD

Eclipse Galileo Feature Top 10 List, Number 2

고포릿 2009. 6. 25. 08:01

역자: Eclipse Galileo가 드디어 시장에 모습을 드러냈습니다. 출시에 맞춰 갈릴레오에 대해 하나 하나 배워가보겠다는 생각에 관련 글을 미력하지만 번역해 봅니다 - 고포릿.

원문: http://eclipsesource.com/blogs/2009/06/23/eclipse-galileo-feature-top-10-list-number-2/

 

 

Eclipse Galileo Feature Top 10 List, Number 2 on Jun 23rd, 2009

많은 사람들이 벌써 Galileo is available for Friends of Eclipse 이라고 한다. Chris pointed-out 에서 지적했듯이 이클립스가 질 높은 소프트웨어를 적시에 출시하는 이유중의 하나는 OSGi가 제시하는 모듈방식 때문이다.

OSGi 사용하므로서 개발자들은 독립적으로 자신의 모듈 작업을 수행하고, 마지막에 제품으로 조립할 수 있다.  콤포넌트화에 대해 말하자면, OSGi는 lazy loading을 가능하게 한다. 각 번들은 'services'에 기여할 수 있고 이런 번들들은 서비스가 사용되어야만 활성화된다.  이것이 의미하는 것은 10개의 번들을 가진 작은 Embeded OSGi  application은 1000개 이상 번들을 가진 최고 사양의 IDE 만큼 반응한다 .(역자: 역설적으로 표현한 것 같다. 번들이 많건 적건 동일한 기대치를 갖는 다는 의미로 받아 들인다) 서비스 근간의 lazy programming model은 아주 강력하고, 그렇지만 정확성을 갖기는 매우 어렵다. Eclipse 3.5 에서는 first class citizen인 OSGi Declarative Services 를 만들어서 이런 우려를 완전히 바꾸어 놓았다. 이것이 나의 Galileo Features Top 10중에서 No 2 이다.

(역자: first class citizen, 프로그래밍 언어에서 제한없이 사용할 수 있는 엔터티를 의미. wikipedia

Declarative Services (DS) 라는 것은, 번들 사이를 교차해서 서비스들을 함께 묶기 쉽게 만들어 주는 OSGi specification 이다(wire services together across bundles).  DS를 사용해서 개발자는 번들이 제공하는 것과 요구되는 서비스를 명시할 수 있고 이것은 XML을 사용해 선언적으로 명시하고 DS번들은 모든 것을 묶는 책임이 있다. Huge kudos go out to ProSyst for this work, with special thanks to Stoyan.

 

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
name="Command Provider for Dictionary Service">
<implementation class="org.example.ds.ServiceComponent"/>
<service>
<provide interface="org.eclipse.osgi.framework.console.CommandProvider"/>
</service>
<reference bind="setDictionary" cardinality="1..1" interface="org.example.ds.DictionaryService"
name="Dictionary"
policy="static"
unbind="unsetDictionary"/>
</scr:component>

위의 예는 “CommandProvider” 제시하는 콤포넌트이고 “Dictionary Service” 단일 instance를 요구하고 있다. “Dictionary Service”는 Service Tracker를 사용한 번들 활성자에서 준비된다:


// register the service
context.registerService(DictionaryService.class.getName(), service, props);
// create a tracker and track the service
dictionaryServiceTracker = new ServiceTracker(context, DictionaryService.class.getName(), null);
dictionaryServiceTracker.open();
// have a service listener to implement the whiteboard pattern
fContext.addServiceListener(this, "(objectclass=" + Dictionary.class.getName() + ")");

Command Provider and the Dictionary 가 존재한다고 가정하고, 실행을 하게되면 사용자는 OSGi 콘솔을 사용해서 문장을 찾아 볼 수 있다:

console

많은 이클립스 런타임 기술 처럼 Eclipse tools 중 무엇이 주류로 띄우느냐 인데. Eclipse 3.5에서는 번들개발환경(PDE)가 DS와 작업하게 상위층으로 소개되고 있다. DS tooling을 사용하려면 component.xml 을 폼 형식 에디터를 사용해 다루어야 한다. 이런 tooling을 제공한 Chris Aniszczyk and Rafael Nobrega 에게 아주 큰 감사를 한다.

 

tooling

또한 Template로 좀 더 쉽게 시작하게 Chris가 추가했다. 간편하게  New Plug-in Project 를 선태해 OSGi Declarative Services Example 를 선택하면 된다.

template

이클립스는 주요 표준의 다수를 오픈소스로 제공, 구현 사례를 선도적으로 제공하는 일을 지속하고 있다. 공개된 구현 사례와 조직의 이익은:

  • 개발비용을 공유
  • 실현 사례를 아주 거대한 사용자 층을 기반으로 테스트할 수 있다.
  • 기술을 아주 거대한 사용자 층을 기반으로 전파 할 수 있다.
  • 서로 다른 다양한 사람들과 작업 결과를 기여할 수 있다.

 

DS와 OSGi의 정보를 얻고자 한다면 new book by Jeff McAffer, Paul VanderLei and Simon Archer. 를 참조하라.

Thanks to ProSyst, Chris, Rafael and everyone else who worked on this implementation.  Another shining example of the win-win situation enabled by open source software development.

 

이 글은 스프링노트에서 작성되었습니다.