5. 블로그 검색
블로그 검색의 4단계
2. 쿼리 해석 후
프로바이더로 전송 Blog
1. 쿼리
블로그
블로그
트래킹
검색기
프로바이더
4. 파싱 후
응답 전송 3. 프로바이더가
응답(XML or JSON) Blog
12년 3월 18일 일요일
6. send response from provider
Blog Figure 5.1 Four steps in
블로그 검색
searching the blogosphere
Therefore, to develop a generic framework, we need the four main interfaces that are
shown in figure 5.2:
인터페이스 아키텍처
I BlogQueryParameter: captures the query made by the client
I BlogSearcher: translates and submits the query to the provider
I BlogSearchResponseHandler: used by the BlogSearcher to process the response
XML
I BlogQueryResult: the canonical response to query
Figure 5.2 The generic architecture for the blog searcher
12년 3월 18일 일요일
7. 예제 실행 환경
블로그 트래킹 프로바이더
Http Open API 제공
Response: XML
필요 라이브러리
Apache http-client: 3.x
Apache Xerces-j
Apache commons-codec, commons-logging
12년 3월 18일 일요일
8. Figure 5.9 shows the classes that will extend BlogQueryParameterImpl to configure
the URL that the instance of BlogSearcher will access.
So far we’ve implemented the base classes for our framework. Now let’s integrate
클래스 아키텍처(1/2)
various blog-tracking providers. We begin with integrating Technorati, who tracks the
largest number of blogs—more than 112.8 million blogs as of September 2008. I
selected Technorati and Bloglines for their popularity, as well as to illustrate how to
integrate a custom API.
I <<Interface>>
BlogQueryParameter
<<realize>>
C BlogQueryParameterImpl
C TechnoratSearchBlogQueryParameterImpl C BlogLineSearchBlogQueryParameterImpl
C TechnoratTagBlogQueryParameterImpl C RSSFeedBlogQueryParameterImpl
Figure 5.9 The classes extending BlogQueryParameterImpl
12년 3월 18일 일요일
Licensed to Lin He <mcaca441@gmail.com>
9. Implementing the base classes 127
5 Extending the framework
클래스 아키텍처(2/2)
Figure 5.8 gives an overview of the classes that we build. Basically, for each integration,
we extend the three classes: BlogSearcherImpl for blog searching, BlogSearch-
ResponseHandlerImpl for handling the XML response, and BlogQueryParameterImpl
for configuring the search parameters.
<<realize>>
<<realize>>
<<realize>>
<<realize>>
Figure 5.8 The interfaces and their implementing classes
Figure 5.9 shows the classes that will extend BlogQueryParameterImpl to configure
12년 3월 18일 일요일