<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kimkijeung.com &#187; Java</title>
	<atom:link href="http://kimkijeung.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://kimkijeung.com</link>
	<description>Interactive development,flash,Actionscript</description>
	<lastBuildDate>Wed, 14 Jul 2010 09:57:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
			<title>Kimkijeung.com</title>
			<url>http://kimkijeung.com/blog/wp-content/uploads/2009/12/index.gif</url>
			<link>http://kimkijeung.com</link>
			<width></width>
			<height></height>
			<description>Interactive development,flash,Actionscript</description>
		</image>		<item>
		<title>Why abstract Method</title>
		<link>http://kimkijeung.com/2006/11/20/why-abstract-method/</link>
		<comments>http://kimkijeung.com/2006/11/20/why-abstract-method/#comments</comments>
		<pubDate>Sun, 19 Nov 2006 15:38:53 +0000</pubDate>
		<dc:creator>vkimone</dc:creator>
				<category><![CDATA[Programming-OOP&OOD]]></category>
		<category><![CDATA[abstract class]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[polymorphism]]></category>

		<guid isPermaLink="false">http://vkimone.inblog.kr/?p=361</guid>
		<description><![CDATA[상속가능한 메소드 구현(즉, 실제본체가 있는 메소드)은 상위 클래스에 집어넣기에 딱 좋다.
하지만 추상 클래스에서는 하위 클래스에서 유용하게 써먹을 수 있는 일반적인 코드를 전혀 만들 수 없기 때문에 메소드를 구현한다는 것이 아예 말이 안 되는 경우가 종종 있다. 추상메소드를 만드는 이유는 실제 메소드 코드를 전혀 집어넣지는 않더라도 일련의 하위클래스를 위한 규약(protocol)의 일부를 정의하기 위한 것이다.
그렇다면 장점은?&#8230;&#8230;.
OOP의 핵심이라 [...]]]></description>
			<content:encoded><![CDATA[<p>상속가능한 메소드 구현(즉, 실제본체가 있는 메소드)은 상위 클래스에 집어넣기에 딱 좋다.<br />
하지만 추상 클래스에서는 하위 클래스에서 유용하게 써먹을 수 있는 일반적인 코드를 전혀 만들 수 없기 때문에 메소드를 구현한다는 것이 아예 말이 안 되는 경우가 종종 있다. 추상메소드를 만드는 이유는 실제 메소드 코드를 전혀 집어넣지는 않더라도 일련의 하위클래스를 위한 규약(protocol)의 일부를 정의하기 위한 것이다.</p>
<p>그렇다면 장점은?&#8230;&#8230;.</p>
<p>OOP의 핵심이라 할 수 있는 다형성(polymorphism)이다.<br />
상위클래스 유형을 메소드의 인자나 리턴유형 또는 배열유형으로 쓸 수 있게 만드는 능력이 필요하다. 그래야만 새로운 유형을 처리하기 위한 새로운 메소드를 추가하거나 기존의 메소드를 고칠 필요없이 프로그램에 새로운 하위클래스 유형을 추가할 수 있기 때문이다.</p>
<p>플래시에서는 추상클래스를 지원하지는 않는다.<br />
하지만 추상클래스 보다 더 추상적인 개념인 인터페이스(interface)가 존재한다. 물론 자바에서 사용되는 인터페이스와 똑같다.<br />
앞으로 사용될 AS3.0 에서도 추상클래스는 지원하지 않지만 인터페이스 만으로도 비슷한 역할을 구현할 수 있을 것이다. </p>
]]></content:encoded>
			<wfw:commentRss>http://kimkijeung.com/2006/11/20/why-abstract-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classes in As and  Java or C++</title>
		<link>http://kimkijeung.com/2006/08/30/classes-in-as-and-java-or-c/</link>
		<comments>http://kimkijeung.com/2006/08/30/classes-in-as-and-java-or-c/#comments</comments>
		<pubDate>Wed, 30 Aug 2006 08:37:52 +0000</pubDate>
		<dc:creator>vkimone</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://vkimone.inblog.kr/?p=305</guid>
		<description><![CDATA[[퍼온글] 출처 : &#60;Flex 2 language Reference 36 page&#62;
Programmers familiar with object-oriented programming (OOP) in Java or C++ may think of objects as modules that contain two kinds of members: data stored in member variables or properties, and behavior accessible through methods. The ECMAScript edition 4 draft, the standard upon which ActionScript 3.0 is based, [...]]]></description>
			<content:encoded><![CDATA[<p>[퍼온글] 출처 : &lt;Flex 2 language Reference 36 page&gt;</p>
<p>Programmers familiar with object-oriented programming (OOP) in Java or C++ may think of objects as modules that contain two kinds of members: data stored in member variables or properties, and behavior accessible through methods. The ECMAScript edition 4 draft, the standard upon which ActionScript 3.0 is based, defines objects in a similar but slightly different way. In the ECMAScript draft, objects are simply collections of properties. These properties are containers that can hold not only data, but also functions or other objects. If a function is attached to an object in this way, it is called a method.<br />
While the ECMAScript draft definition may seem a little odd to programmers with a Java or C++ background, in practice, defining object types with ActionScript 3.0 classes is very similar to the way classes are defined in Java or C++. The distinction between the two definitions of object is important when discussing the ActionScript object model and other advanced topics, but in most other situations the term properties means class member variables as opposed to methods. The Flex 2 Language Reference, for example, uses the term properties to mean variables or getter-setter properties. It uses the term methods to mean functions that arepart of a class.</p>
<p><strong>One subtle difference between classes in ActionScript and classes in Java or C++ is that in ActionScript, classes are not just abstract entities.</strong> ActionScript classes are represented by class objects that store the class’s properties and methods. This allows for techniques that may seem alien to Java and C++ programmers, such as including statements or executable code at the top level of a class or package.</p>
<p><strong>Another difference between ActionScript classes and Java or C++ classes is that every ActionScript class has something called a prototype object.</strong> In previous versions of ActionScript, prototype objects, linked together into prototype chains, served collectively as the foundation of the entire class inheritance hierarchy. In ActionScript 3.0, however, prototype objects play only a small role in the inheritance system. The prototype object can still be useful, however, as an alternative to static properties and methods if you want to share a property and its value among all the instances of a class.</p>
<p>In the past, advanced ActionScript programmers could directly manipulate the prototype chain with special built-in language elements. Now that the language provides a more mature implementation of a class-based programming interface, many of these special language elements, such as __proto__ and __resolve, are no longer part of the language.</p>
<p>Moreover, optimizations of the internal inheritance mechanism that provide significant Flash Player performance improvements preclude direct access to the inheritance mechanism.<br />
actionscript 와 java or c++ 의 class 간의 개념이 약간 다르다.<br />
어찌보면 다아나믹한 움직임을 구현하기 위해선 필요한 차이점인지 모른다.<br />
그래도 ECMAScript 기반의 언어라 그런지 java 와는 외향이 거의 흡사해진다는 느낌이다.</p>
<p>prototype 은 뭔가 꺼림직해서 이전부터 건드리지 않은 부분이지만 아니나 다를까 성능에 문제가 있을 수 있다고 하니 protoype object 는 터치하지 말아야 겠다&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kimkijeung.com/2006/08/30/classes-in-as-and-java-or-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adapter pattern(1)</title>
		<link>http://kimkijeung.com/2006/07/01/adapter-pattern1/</link>
		<comments>http://kimkijeung.com/2006/07/01/adapter-pattern1/#comments</comments>
		<pubDate>Sat, 01 Jul 2006 12:41:33 +0000</pubDate>
		<dc:creator>vkimone</dc:creator>
				<category><![CDATA[Programming-OOP&OOD]]></category>
		<category><![CDATA[Design pattern]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://vkimone.inblog.kr/?p=233</guid>
		<description><![CDATA[상속에 의한 Adapter 패턴 -  가장 기본이 되는 클래스를 중심으로 클래스를 확장하는 방법으로 인터페이스로 구현하는 방식, 어쩌면 클래스 확장에 있어 가장 기본이 되는 디자인 패턴인듯 싶다.
플래시에서도 가장 쉽게 적용되는 방식이다.
*Adaptee &#8211; Banner Class
접합하는 측이 아니라 접합되는 측. 이미 준비되어있는 메소드를 가지고 있는 역할.

public class Banner&#123;
  private String string;
&#160;
  public Banner&#40;String string&#41;&#123;
  this.string=string;
 [...]]]></description>
			<content:encoded><![CDATA[<p>상속에 의한 Adapter 패턴 -  가장 기본이 되는 클래스를 중심으로 클래스를 확장하는 방법으로 인터페이스로 구현하는 방식, 어쩌면 클래스 확장에 있어 가장 기본이 되는 디자인 패턴인듯 싶다.</p>
<p>플래시에서도 가장 쉽게 적용되는 방식이다.</p>
<p><strong>*Adaptee &#8211; Banner Class</strong></p>
<p>접합하는 측이 아니라 접합되는 측. 이미 준비되어있는 메소드를 가지고 있는 역할.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Banner<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> string<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> Banner<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">string</span><span style="color: #339933;">=</span>string<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> showWithParen<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">printIn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;(&quot;</span><span style="color: #339933;">+</span>string<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> showWithAster<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">printIn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #339933;">+</span>string<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;*&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>*Target &#8211; Print Interface</strong></p>
<p>필요로 하는 메소드를 제공하는 역할.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Print<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> printWeak<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000066; font-weight: bold;">void</span> printStrong<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>*Adapter &#8211; PrintBanner Class</strong></p>
<p>Adaptee 역할의 메소드를 사용하여 Target 역할을 충족시키는 역할.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PrintBanner <span style="color: #000000; font-weight: bold;">extends</span> Banner <span style="color: #000000; font-weight: bold;">implements</span> Print<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> PrintBanner<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> printWeak<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  showWithParen<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> printStrong<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  showWithAster<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>*Client &#8211; Main Class</strong></p>
<p>Target 역할의 메소드를 사용해서 일을 하는 역할</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
Print p<span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PrintBanner<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hellow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
p.<span style="color: #006633;">printWeak</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
p.<span style="color: #006633;">printStrong</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Print interface 를 사용하여 구현하고 있다는 점을 강조하기 위해 인스턴스 변수를 Print 형 변수에 대입하여 사용함&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kimkijeung.com/2006/07/01/adapter-pattern1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Design Patterns in Java</title>
		<link>http://kimkijeung.com/2006/06/18/the-design-patterns-in-java/</link>
		<comments>http://kimkijeung.com/2006/06/18/the-design-patterns-in-java/#comments</comments>
		<pubDate>Sun, 18 Jun 2006 11:24:09 +0000</pubDate>
		<dc:creator>vkimone</dc:creator>
				<category><![CDATA[Programming-OOP&OOD]]></category>
		<category><![CDATA[Design pattern]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://vkimone.inblog.kr/?p=205</guid>
		<description><![CDATA[The Design Patterns in Java : Table of Contents
Some Background on Design Patterns

Object-Oriented Programming Concepts  
Defining Design Patterns 


1. Creational Patterns

The Factory Pattern 
The Abstract Factory Pattern 
The Singleton Factory Pattern 
The Builder Pattern 
The Prototype Pattern 
Summary of Creational Patterns 


2. Structural Patterns

The Adapter Pattern 
The Bridge Pattern 
The Composite Pattern 
The Decorator [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Design Patterns in Java : Table of Contents</strong></p>
<blockquote><dl><strong><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/background.html" target="_blank">Some Background on Design Patterns</a></strong>
<dl>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/object.html" target="_blank">Object-Oriented Programming Concepts </a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/defining.html" target="_blank">Defining Design Patterns</a> </dt>
</dl>
</dl>
<dl><strong><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/creation.html" target="_blank">1. Creational Patterns</a></strong>
<dl>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/factory.html" target="_blank">The Factory Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/abfactory.html" target="_blank">The Abstract Factory Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/singleton.html" target="_blank">The Singleton Factory Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/builder.html" target="_blank">The Builder Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/prototype.html" target="_blank">The Prototype Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/suCreation.html" target="_blank">Summary of Creational Patterns</a> </dt>
</dl>
</dl>
<dl><strong><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/structural.html" target="_blank">2. Structural Patterns</a></strong>
<dl>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/adapter.html" target="_blank">The Adapter Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/bridge.html" target="_blank">The Bridge Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/composite.html" target="_blank">The Composite Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/decorate.html" target="_blank">The Decorator Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/facade.html" target="_blank">The Facade Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/flyweight.html" target="_blank">The Flyweight Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/proxy.html" target="_blank">The Proxy Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/suStruct.html" target="_blank">The Summary of Patterns</a> </dt>
</dl>
</dl>
<dl><strong><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/behavior.html" target="_blank">3. Behavioral Patterns</a></strong>
<dl>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/chain.html" target="_blank">Chain of Responsibility</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/command.html" target="_blank">The Command Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/interpreter.html" target="_blank">The Interpreter Pattern</a></p>
<p><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/iterator.html" target="_blank">The Iterator Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/mediator.html" target="_blank">The Mediator Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/memento.html" target="_blank">The Memento Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/observer.html" target="_blank">The Observer Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/state.html" target="_blank">The State Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/strategy.html" target="_blank">The Strategy Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/template.html" target="_blank">The Template Pattern</a> </dt>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/visitor.html" target="_blank">The Visitor Pattern</a> </dt>
</dl>
</dl>
<dl><strong><a class="con_link" target="_blank">Appendix</a></strong>
<dl>
<dt><a class="con_link" href="http://compstat.chonbuk.ac.kr/rightway/designpatterns/index.html" target="_blank">Standard Coding Rules</a> </dt>
<dt><a class="con_link" target="_blank">UML</a> </dt>
<dt><a class="con_link" target="_blank">References</a> </dt>
</dl>
</dl>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://kimkijeung.com/2006/06/18/the-design-patterns-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java에서 리소스 사용의 균형</title>
		<link>http://kimkijeung.com/2006/05/24/java%ec%97%90%ec%84%9c-%eb%a6%ac%ec%86%8c%ec%8a%a4-%ec%82%ac%ec%9a%a9%ec%9d%98-%ea%b7%a0%ed%98%95/</link>
		<comments>http://kimkijeung.com/2006/05/24/java%ec%97%90%ec%84%9c-%eb%a6%ac%ec%86%8c%ec%8a%a4-%ec%82%ac%ec%9a%a9%ec%9d%98-%ea%b7%a0%ed%98%95/#comments</comments>
		<pubDate>Wed, 24 May 2006 12:53:53 +0000</pubDate>
		<dc:creator>vkimone</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://localhost:8888/blog/?p=138</guid>
		<description><![CDATA[C++과 달리 자바에서는 게으른 방식의 자동 객체 삭제를 사용한다. 참조가 없는 객체들은 가비지 콜랙션(garbage collection)의 후보가 되며, 만약 가비지 콜랙션이 그 객체들을 지우려고 하기만 한다면, 객체의 finalize 메서드가 호출될 것이다.
더이상 대부분 메모리 누수 책임을 지지 않게 되어 개발자에게는 아주 편해진 일이지만, C++방식대로 자원을 청소하도록 구현하기는 어려워졌다.
다행스럽게도 사려깊은 자바 언어의 설계자들은 이것을 보상하기 위한 기능 하나를 [...]]]></description>
			<content:encoded><![CDATA[<p>C++과 달리 자바에서는 게으른 방식의 자동 객체 삭제를 사용한다. 참조가 없는 객체들은 가비지 콜랙션(garbage collection)의 후보가 되며, 만약 가비지 콜랙션이 그 객체들을 지우려고 하기만 한다면, 객체의 finalize 메서드가 호출될 것이다.</p>
<p>더이상 대부분 메모리 누수 책임을 지지 않게 되어 개발자에게는 아주 편해진 일이지만, C++방식대로 자원을 청소하도록 구현하기는 어려워졌다.</p>
<p>다행스럽게도 사려깊은 자바 언어의 설계자들은 이것을 보상하기 위한 기능 하나를 추가해두었다.</p>
<p>finally 절이 그것이다. try 블록에 finally절이 들어있다면, 그절안의 코드들은 try 블록 안의 코드가 한문장이라도 실행되면 반드시 실행되도록 되어있다. 예외가 던져지더라도 상관없다.</p>
<p>finally 절 안의 코드는 반드시 실행된다. 이말은 다음과 같은 코드로 리소스 사용의 균형을 잡을 수 있다는 뜻이다.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> dosomething<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span><span style="color: #009900;">&#123;</span>
&nbsp;
       <span style="color: #003399;">File</span> tmpFile <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span>tmpFileName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #003399;">FileWriter</span> tmp <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileWriter</span><span style="color: #009900;">&#40;</span>tmpFile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #000000; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
               <span style="color: #666666; font-style: italic;">//실행코드</span>
       <span style="color: #009900;">&#125;</span>
       <span style="color: #000000; font-weight: bold;">finally</span><span style="color: #009900;">&#123;</span>
               tmpFile.<span style="color: #006633;">delete</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>이 루틴에서 사용한 임시파일은 루틴에서 어떻게 나가든 지워야 한다.<br />
finally 블록이 이렇게 간결하게 해결해 준다.</p>
]]></content:encoded>
			<wfw:commentRss>http://kimkijeung.com/2006/05/24/java%ec%97%90%ec%84%9c-%eb%a6%ac%ec%86%8c%ec%8a%a4-%ec%82%ac%ec%9a%a9%ec%9d%98-%ea%b7%a0%ed%98%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
