<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx</link><description>Other posts: Part I - Using a class Part II - Making the class better Part III - Using a struct Part IV - A class with a special value In the last post we presented a variation of implementing a value object using a class. Everything works (obviously),</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Geek Lectures - Things geeks should know about &amp;raquo; Blog Archive   &amp;raquo;  Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7078250</link><pubDate>Fri, 11 Jan 2008 22:25:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7078250</guid><dc:creator>Geek Lectures - Things geeks should know about » Blog Archive   »  Creating an immutable value object in C# - Part V - Using a library</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://geeklectures.info/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library/"&gt;http://geeklectures.info/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Immutability in C#</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7136547</link><pubDate>Thu, 17 Jan 2008 02:44:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7136547</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;For some reason, there's been a lot of buzz lately around immutability in C#. If you're interested in&lt;/p&gt;
</description></item><item><title>Community Convergence XXXIX</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7180738</link><pubDate>Mon, 21 Jan 2008 09:45:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7180738</guid><dc:creator>Charlie Calvert's Community Blog</dc:creator><description>&lt;p&gt;Welcome to the XXXIX issue of Community Convergence. The big news this week is that Microsoft has begun&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7380365</link><pubDate>Sat, 02 Feb 2008 04:06:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7380365</guid><dc:creator>mg</dc:creator><description>&lt;p&gt;Nice work! &lt;/p&gt;
&lt;p&gt;One question about &amp;quot;stealing&amp;quot; the base class - what about introducing another layer of abstraction and instead of declaring your type like this:&lt;/p&gt;
&lt;p&gt;public class DateSpan: Record&amp;lt;DateTime, DateTime, bool&amp;gt; {...}&lt;/p&gt;
&lt;p&gt;do something like this:&lt;/p&gt;
&lt;p&gt;public class DateSpan: ValueObject&amp;lt;Record&amp;lt;DateTime, DateTime, bool&amp;gt;&amp;gt; {...}&lt;/p&gt;
&lt;p&gt;The ValueObject class would then expose the record to as a protected property and pass Equals, ToString... to the Record object. It would make the declarations a little bit more complicated, but your biggest drawback is not a problem anymore.&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7441648</link><pubDate>Mon, 04 Feb 2008 20:07:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7441648</guid><dc:creator>lucabol</dc:creator><description>&lt;p&gt;I think I'm missing something. Aren't you still stealing the base class with the ValueObject class?&lt;/p&gt;
&lt;p&gt;I.E. you cannot declare DateSpan to inherit from a MySpan class.&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7444846</link><pubDate>Mon, 04 Feb 2008 22:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7444846</guid><dc:creator>mg</dc:creator><description>&lt;p&gt;Well, I was thinking about ValueObject more in terms of a type system base class, where you can put your additional behaviour and not spoil the Record class. You are right that still you cannot have a deeper hierarchy of types with this solution.&lt;/p&gt;
&lt;p&gt;BTW: don't you think it would be nice to have a language support for immutable types? Something like:&lt;/p&gt;
&lt;p&gt;public readonly class MyClass...&lt;/p&gt;
&lt;p&gt;where all fields are readonly fields of readonly types?&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7445322</link><pubDate>Mon, 04 Feb 2008 22:44:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7445322</guid><dc:creator>lucabol</dc:creator><description>&lt;p&gt;Yeah, you are right.&lt;/p&gt;
&lt;p&gt;We talked about having first class readonly classes a bunch of times, but we never came up with a proposal we are happy with. We are still discussing the topic.&lt;/p&gt;
</description></item><item><title>Code generation</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7488322</link><pubDate>Wed, 06 Feb 2008 13:25:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7488322</guid><dc:creator>Doekman</dc:creator><description>&lt;p&gt;Isn't code generation a much better option at this time, while 1st class readonly classes aren't available?&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7493057</link><pubDate>Wed, 06 Feb 2008 19:02:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7493057</guid><dc:creator>lucabol</dc:creator><description>&lt;p&gt;It is an option. I wouldn't say it is better. It has pros and cons (i.e. readibility, amount of code, mantainability).&lt;/p&gt;
&lt;p&gt;As for me, I prefer library solutions to codegen whenever available (and roughly usable).&lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7546853</link><pubDate>Sat, 09 Feb 2008 00:53:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7546853</guid><dc:creator>qq</dc:creator><description>&lt;p&gt;I think you guys in immutable space have frankly lost it. It is not new, it is common principles that do not apply in all fields, and just because functional attempts are again popular you are hitting on attempting to solve a problem with a wrong tool: .net type system.&lt;/p&gt;
&lt;p&gt;If you think magically you will somehow parallelise code and algorithms, you are in for a big 'immutable surprise'.&lt;/p&gt;
&lt;p&gt;No, silver, bullet.. &lt;/p&gt;
</description></item><item><title>re: Creating an immutable value object in C# - Part V - Using a library</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#7547378</link><pubDate>Sat, 09 Feb 2008 01:32:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7547378</guid><dc:creator>lucabol</dc:creator><description>&lt;p&gt;All these posts say is: iff you need an immutable class, here are a bunch of options of how to do it in C#.&lt;/p&gt;
&lt;p&gt;I don't think I'm claiming anything more than that. Am I?&lt;/p&gt;
</description></item><item><title>A C# library to write functional code - Part II - Tuples</title><link>http://blogs.msdn.com/lucabol/archive/2008/01/11/creating-an-immutable-value-object-in-c-part-v-using-a-library.aspx#8369981</link><pubDate>Wed, 09 Apr 2008 00:06:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8369981</guid><dc:creator>Luca Bolognese's WebLog</dc:creator><description>&lt;p&gt;Previous posts: Part I - Background Tuples are a way for you not to name things. In Object Oriented languages&lt;/p&gt;
</description></item></channel></rss>