<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=ChoosingMessage</id>
	<title>ChoosingMessage - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=ChoosingMessage"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=ChoosingMessage&amp;action=history"/>
	<updated>2026-05-15T01:32:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=ChoosingMessage&amp;diff=84208&amp;oldid=prev</id>
		<title>Maintenance script: Repair batch-0001 pages from live compare</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=ChoosingMessage&amp;diff=84208&amp;oldid=prev"/>
		<updated>2026-03-26T23:56:04Z</updated>

		<summary type="html">&lt;p&gt;Repair batch-0001 pages from live compare&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:56, 26 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[SBPPSummary]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[SBPPSummary]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=ChoosingMessage&amp;diff=30256&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:22, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=ChoosingMessage&amp;diff=30256&amp;oldid=prev"/>
		<updated>2021-02-07T05:22:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Choosing Message ===&lt;br /&gt;
뭐라고 주저리 주저리 많긴 한데... 결국 다형성 이야기다.&lt;br /&gt;
----&lt;br /&gt;
절차적 프로그램은 if-then-else나 switch-case같은 조건문으로 구현이 된다. 이렇게 구현된 것은 두가지 문제점을 가지고 있다. 하나는 기존 프로그램의 수정 없이는 새로운 기능을 추가할 수가 없고, 또 다른 하나는, 그러한 것은 전파되려 한다는 것이다.(? 고치면 파급 효과가 크다는 이야기같다.)&lt;br /&gt;
----&lt;br /&gt;
이에 반해, 메세지는 주제와 변수를 다루는 프로그램을 훈련된 방법을 제공해준다.(직역 열라 이상함.--; 누군가 좀..;;)&lt;br /&gt;
변수들이 서로 다른 오브젝트에 있으므로, 서로를 간섭할 기회가 많지 않다. &lt;br /&gt;
----&lt;br /&gt;
일단 안 좋은 코드를 보자. 기존의 절차적 프로그램에서나 볼 수 있는 코드다. 초보자들이 자주 이런다. 본인도 그렇다.--;&lt;br /&gt;
 // MFC를 가정하자. C++ 표준에서 타입 알아오는 걸 까먹었다. CObject를 상속받은 것이다.&lt;br /&gt;
 if( anEntry-&amp;amp;gt;IsKindOf(RUNTIME_CLASS(Film)) )&lt;br /&gt;
 	responsible = anEntry-&amp;amp;gt;getProducer();	&lt;br /&gt;
 else&lt;br /&gt;
 	responsible = anEntry-&amp;amp;gt;getAuthor();&lt;br /&gt;
----&lt;br /&gt;
위의 코드를 Choosing Message 패턴을 써서 유연한 코드로 바꿔보자.&lt;br /&gt;
 class Entry : public CObject&lt;br /&gt;
 {&lt;br /&gt;
 	Responsible&amp;amp;amp; GetResponsible()&lt;br /&gt;
 	{&lt;br /&gt;
 		return author;&lt;br /&gt;
 	}&lt;br /&gt;
 };&lt;br /&gt;
 &lt;br /&gt;
 class Film : public Entry&lt;br /&gt;
 {&lt;br /&gt;
 	Responsible&amp;amp;amp; GetResponsible()&lt;br /&gt;
 	{&lt;br /&gt;
 		return producer;&lt;br /&gt;
 	}&lt;br /&gt;
 };&lt;br /&gt;
 responsible = anEntry-&amp;amp;gt;GetResponsible();&lt;br /&gt;
----&lt;br /&gt;
[[SBPPSummary]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>