<?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>Pompi Pompi - A Gamers and Developers blog for indie games &#187; Software Design</title>
	<atom:link href="http://www.pompidev.net/category/software-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pompidev.net</link>
	<description>A blog about indie game development for both gamers and developers</description>
	<lastBuildDate>Fri, 05 Mar 2010 18:27:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Accessing privates without &#8216;friend&#8217;(c++)</title>
		<link>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/</link>
		<comments>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:12:34 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=427</guid>
		<description><![CDATA[Here is a neat little way I found to make one class access the privates of another class, without using friend or direct inheritance. Take a look at this code:

class A {
    public:
        class Observer {
          [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a neat little way I found to make one class access the privates of another class, without using friend or direct inheritance. Take a look at this code:</p>
<p><code lang="cpp"></p>
<pre>class A {
    public:
        class Observer {
             protected:
                 int GetPrivate(A &amp; a) {return a.ValueA;};
        };
    private:
        int ValueA;
};

class B: public A::Observer {
    public:
        void Foo (A &amp; a) {
             cout&lt;&lt;GetPrivate(A);
        }
};</pre>
<p> </p>
<p></code>Class B cannot access the privates of class A directly, but it inherits a subclass of A that can access the privates of A given as a parameter. Since I have just tried this &#8220;pattern&#8221; recently, I am not sure what is the direct benefit of this.</p>
<p>I believe a benefit can be in the sense of making a programmer&#8217;s life easier. Programming languages play several parts. They provide us powerful functionality, but they also suppose to give us ease of use. You can program anything on assembly, but it would be really difficult to write a big game in assembly.<br />
If you do not expose privates via a getter, you give the programmer one less method to think about when he need to use the class&#8217;s instance for something.</p>
<p>Can you think how you would use this &#8220;pattern&#8221;? Do you think there is no use for it?<br />
Tell me what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Lesson from blog categories.</title>
		<link>http://www.pompidev.net/2009/09/08/lesson-from-blog-categories/</link>
		<comments>http://www.pompidev.net/2009/09/08/lesson-from-blog-categories/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 21:06:21 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=14</guid>
		<description><![CDATA[As I posted my first blog posts, I seemed to have difficulties in creating categories for them.
Why was it so hard to decide?
Well, that is because I have very little examples to help me decide what categories I need.
It seems more logical to create categories on the go, rather than think of a category for [...]]]></description>
			<content:encoded><![CDATA[<p>As I posted my first blog posts, I seemed to have difficulties in creating categories for them.<br />
Why was it so hard to decide?<br />
Well, that is because I have very little examples to help me decide what categories I need.<br />
It seems more logical to create categories on the go, rather than think of a category for each post, the moment I made that post.</p>
<p>This is very similar to software, you don&#8217;t need to think on certain problems upfront, but rather decide when the need arise. If making changes is not too difficult, you can make changes as you go, add, remove and edit.<br />
There is no need to find the perfect solution right from the start.<br />
The buzz word to describe this way of thinking would be lazy fattening.<br />
That is, you don&#8217;t mind having objects with a lot of features and functionality(fat), but you only add those feature if you encounter a problem that requires you to do so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2009/09/08/lesson-from-blog-categories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
