<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Partial Classes in PHP</title>
	<atom:link href="http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/</link>
	<description>Far Too Sweet To Be Sour</description>
	<pubDate>Mon, 08 Sep 2008 04:31:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Alex</title>
		<link>http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/#comment-96</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 08 Jul 2008 00:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=46#comment-96</guid>
		<description>Thanks for the resource. I'll also throw in my vote for support of partial classes in the next versions of PHP. In case someone of influence comes across this post.


-- Alex</description>
		<content:encoded><![CDATA[<p>Thanks for the resource. I&#8217;ll also throw in my vote for support of partial classes in the next versions of PHP. In case someone of influence comes across this post.</p>
<p>&#8211; Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Cousineau</title>
		<link>http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/#comment-78</link>
		<dc:creator>Daniel Cousineau</dc:creator>
		<pubDate>Wed, 25 Jun 2008 19:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=46#comment-78</guid>
		<description>@iongion: While this code sample was just an exercise in fun, partial classes do have their uses.

Partial classes are not used to fill in or expand any OOP design pattern, and aren't used to do MVC either. Visual Studio does a lot of code generation and partial classes allow you to alter generated code without having to edit the usually unreadable generated code nor worry about losing your changes the next time Visual Studio auto generates code.

The best example I can think of is a class pertaining to a GUI window. Visual Studio (and others like GLADE for GTK, QT Designer, etc.) gives you a visual interface to design a GUI window and generates the code for the window. If you've ever looked at a generated class, while cleaner in C# than other languages, it's still long, terse, and difficult to follow changes. You cannot simply extend the class as launching the window is very dependent on the current class name and you run into issues of Privately scoped variables not being visible to it's children (the extended class).

So partial classes came into existence to allow you to maintain separate files containing code for the same class. While Visual Studio operates on foo.cs, auto generating and regenerating code, you can make all your changes in bar.cs and they merge transparently, allowing you to not worry about losing code to an overwrite or things breaking if an action causes Visual Studio to somewhat radically change the structure of the class or remove methods you had custom code in.</description>
		<content:encoded><![CDATA[<p>@iongion: While this code sample was just an exercise in fun, partial classes do have their uses.</p>
<p>Partial classes are not used to fill in or expand any OOP design pattern, and aren&#8217;t used to do MVC either. Visual Studio does a lot of code generation and partial classes allow you to alter generated code without having to edit the usually unreadable generated code nor worry about losing your changes the next time Visual Studio auto generates code.</p>
<p>The best example I can think of is a class pertaining to a GUI window. Visual Studio (and others like GLADE for GTK, QT Designer, etc.) gives you a visual interface to design a GUI window and generates the code for the window. If you&#8217;ve ever looked at a generated class, while cleaner in C# than other languages, it&#8217;s still long, terse, and difficult to follow changes. You cannot simply extend the class as launching the window is very dependent on the current class name and you run into issues of Privately scoped variables not being visible to it&#8217;s children (the extended class).</p>
<p>So partial classes came into existence to allow you to maintain separate files containing code for the same class. While Visual Studio operates on foo.cs, auto generating and regenerating code, you can make all your changes in bar.cs and they merge transparently, allowing you to not worry about losing code to an overwrite or things breaking if an action causes Visual Studio to somewhat radically change the structure of the class or remove methods you had custom code in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iongion</title>
		<link>http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/#comment-77</link>
		<dc:creator>iongion</dc:creator>
		<pubDate>Wed, 25 Jun 2008 19:10:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=46#comment-77</guid>
		<description>Why wont you simply extend the class ?

"For the uninitiated, it is a way of defining a class in two separate locations." - its not a clean reason to emulate partial classes.

Partial classes in C grill (:P) are imho invented for offering MVC support through the language(why would one do that) in .net framework.

Don't get me wrong, i like the language, i worked with it for 6 years now, but this partial class creation is such a hard to grasp feature, i do not see any concrete OOP pattern (and by this i mean real world concepts), i do not thing they have any concrete representation for the real world, as all the other oop patterns do.</description>
		<content:encoded><![CDATA[<p>Why wont you simply extend the class ?</p>
<p>&#8220;For the uninitiated, it is a way of defining a class in two separate locations.&#8221; - its not a clean reason to emulate partial classes.</p>
<p>Partial classes in C grill (:P) are imho invented for offering MVC support through the language(why would one do that) in .net framework.</p>
<p>Don&#8217;t get me wrong, i like the language, i worked with it for 6 years now, but this partial class creation is such a hard to grasp feature, i do not see any concrete OOP pattern (and by this i mean real world concepts), i do not thing they have any concrete representation for the real world, as all the other oop patterns do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adam</title>
		<link>http://www.toosweettobesour.com/2008/05/01/partial-classes-in-php/#comment-76</link>
		<dc:creator>adam</dc:creator>
		<pubDate>Mon, 23 Jun 2008 15:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=46#comment-76</guid>
		<description>just what i was looking for... i needed a way to separate my generated code from custom hand written code, but wanted both within the same class instance. thanks for posting</description>
		<content:encoded><![CDATA[<p>just what i was looking for&#8230; i needed a way to separate my generated code from custom hand written code, but wanted both within the same class instance. thanks for posting</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.350 seconds -->
