<?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>Mindscape Blog &#187; LightSpeed</title> <atom:link href="http://www.mindscape.co.nz/blog/index.php/category/lightspeed/feed/" rel="self" type="application/rss+xml" /><link>http://www.mindscape.co.nz/blog</link> <description>The official blog of Mindscape</description> <lastBuildDate>Mon, 26 Jul 2010 23:59:06 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>Nightly news, 23 July 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/07/22/nightly-news-23-july-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/07/22/nightly-news-23-july-2010/#comments</comments> <pubDate>Thu, 22 Jul 2010 21:57:31 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1634</guid> <description><![CDATA[We&#8217;ve been busy this week preparing WPF Elements 3.0 for release &#8212; time&#8217;s running out to grab 2.0 and lock in the current pricing &#8212; but we&#8217;ve still found time to ship a bunch of LightSpeed fixes and tweaks. Here&#8217;s what&#8217;s new in this week&#8217;s nightly builds. LightSpeed Fixed invalid UPDATE statements when a class [...]]]></description> <content:encoded><![CDATA[<p>We&#8217;ve been busy this week preparing <a
href="http://www.mindscape.co.nz/blog/index.php/2010/07/08/wpf-elements-3-0-important-notice-for-wpf-customers/">WPF Elements 3.0</a> for release &#8212; time&#8217;s running out to grab 2.0 and <a
href="http://www.mindscape.co.nz/blog/index.php/2010/07/08/wpf-elements-3-0-important-notice-for-wpf-customers/">lock in the current pricing</a> &#8212; but we&#8217;ve still found time to ship a bunch of LightSpeed fixes and tweaks.  Here&#8217;s what&#8217;s new in this week&#8217;s nightly builds.</p><p><a
href="http://www.youtube.com/watch?v=jfEa5Z78avw"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/07/DeveloperNotes3.png" alt="" title="Service with a smile" width="344" height="64" class="alignnone size-full wp-image-1635" /></a></p><p><strong>LightSpeed</strong></p><ul><li>Fixed invalid UPDATE statements when a class table inheritance hierarchy contained a level with no persistent fields</li><li>Added support for further Visual Basic Group By overloads</li><li>Fix for KeyNotFoundException when sorting on the property of an eager-loaded child entity when the association is nullable</li><li>User- and provider-defined types are now displayed in alphabetical order in the designer Data Type drop-down</li><li>Added validation in the designer to detect if an association was redeclared in a derived class</li><li>Fix to allow the designer to work with integrated authentication on Oracle</li><li>The results of Count are now aligned with the results of Find and Count Distinct in paging scenarios</li></ul><p>These fixes and enhancements are available in current nightly builds &#8212; you can <a
href="http://www.mindscape.co.nz/downloads.aspx">get the free Express edition from the downloads page</a> or the retail edition from <a
href="http://www.mindscape.co.nz/store/myaccount.aspx">the store</a>.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F22%2Fnightly-news-23-july-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F22%2Fnightly-news-23-july-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/07/22/nightly-news-23-july-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 16 July 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/07/15/nightly-news-16-july-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/07/15/nightly-news-16-july-2010/#comments</comments> <pubDate>Thu, 15 Jul 2010 21:12:44 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[WPF Elements]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1623</guid> <description><![CDATA[Did you know? According to I Write Like, the LightSpeed designer code generation templates are written in the inimitable style of H P Lovecraft. I must get JD to run up a new logo. In the meantime, here&#8217;s what&#8217;s new in the latest Mindscape product nightly builds. LightSpeed Fix for designer DTO compilation error if [...]]]></description> <content:encoded><![CDATA[<p>Did you know?  According to <a
href="http://iwl.me/">I Write Like</a>, the LightSpeed designer code generation templates are written in the inimitable style of <a
href="http://www.hplovecraft.com/">H P Lovecraft</a>.  I must get JD to run up a new logo.  In the meantime, here&#8217;s what&#8217;s new in the latest Mindscape product nightly builds.</p><p><a
href="http://lolthulhu.com/"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/07/DeveloperNotes2.png" alt="" title="Ph&#039;nglui mglw&#039;nafh Cthulhu R&#039;lyeh wgah&#039;nagl fhtagn" width="344" height="64" class="alignnone size-full wp-image-1624" /></a></p><p><strong>LightSpeed</strong></p><ul><li>Fix for designer DTO compilation error if entities were declared internal</li><li>Fix for ordering a query on a property of an associated entity when the association is declared in a derived class and the mapping mode is class table inheritance</li><li>Fix for LINQ projections on SimpleDB</li><li>Fix for generation SQL Compact blob columns from designer</li><li>Fix for inequality comparisons and unique validations on SimpleDB</li><li>Added a feature to the VS2010 designer to warn if the project targets the .NET Client Profile</li><li>Fixed an issue where an empty linked model caused a compiler error</li><li>Fixed &#8220;arrows to nowhere&#8221; when using external class references in VS2010 designer</li><li>Fixed spurious table creation with auto through entities with ambiguously singular/plural names</li></ul><p><strong>WPF Elements</strong></p><ul><li>Added an option to TimePicker to auto-refresh the list of suggested times</li></ul><p>All these fixes and features are included in the currently downloadable nightly builds &#8212; free editions from the <a
href="http://www.mindscape.co.nz/downloads.aspx">downloads page</a>, retail editions from the <a
href="http://www.mindscape.co.nz/store/myaccount.aspx">store</a>.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F15%2Fnightly-news-16-july-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F15%2Fnightly-news-16-july-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/07/15/nightly-news-16-july-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 9 July 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/07/08/nightly-news-9-july-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/07/08/nightly-news-9-july-2010/#comments</comments> <pubDate>Thu, 08 Jul 2010 21:12:24 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[Silverlight Elements]]></category> <category><![CDATA[WPF Elements]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1592</guid> <description><![CDATA[Here&#8217;s the updates and fixes in the latest nightly builds. LightSpeed Added support for ToString() and Convert.ToString() in LINQ expressions Fix for aliasing issue in joins Removed some validation options from the designer for data types where they didn&#8217;t make sense (for example, length validations on boolean properties) Fixed an issue with using SqlXxx data [...]]]></description> <content:encoded><![CDATA[<p>Here&#8217;s the updates and fixes in the latest nightly builds.</p><p><a
href="http://www.amazon.com/Few-Quick-Ones-Collectors-Wodehouse/dp/1590202333"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/07/DeveloperNotes1.png" alt="" title="A few quick ones" width="344" height="64" class="alignnone size-full wp-image-1594" /></a></p><p><strong>LightSpeed</strong></p><ul><li>Added support for ToString() and Convert.ToString() in LINQ expressions</li><li>Fix for aliasing issue in joins</li><li>Removed some validation options from the designer for data types where they didn&#8217;t make sense (for example, length validations on boolean properties)</li><li>Fixed an issue with using SqlXxx data types that was causing problems for SQL Server 2008 spatial queries</li><li>Support composite (&#038;&#038; and ||) expressions in Where Any and All clauses.  (Limited to a single &#038;&#038; or || on VistaDB due a parameter handling issue.)</li><li>Added support for projections in join criteria</li><li>Added support for scoped subqueries in a LINQ Where clause</li><li>Fixed an issue with scalar queries in class table inheritance, which also affected unique validations</li><li>Support Query.Identifier in &#8220;update by query&#8221;</li></ul><p><strong>WPF Elements</strong></p><ul><li>Added a 24-hour clock display option, Maximum and Minimum constraints, TimeSuggestionInterval option and input masking to the TimePicker control</li><li>Fixed an issue with separator display in numeric text boxes</li></ul><p><strong>Silverlight Elements</strong></p><ul><li>Added an ObservableDictionary class</li></ul><p>These fixes and enhancements are in the current nightly builds &#8212; grab the <a
href="http://www.mindscape.co.nz/downloads.aspx">free editions from the downloads page</a> or the <a
href="http://www.mindscape.co.nz/store/myaccount.aspx">retail editions from the store</a>.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F08%2Fnightly-news-9-july-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F08%2Fnightly-news-9-july-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/07/08/nightly-news-9-july-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 2 July 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/07/01/nightly-news-2-july-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/07/01/nightly-news-2-july-2010/#comments</comments> <pubDate>Thu, 01 Jul 2010 23:07:06 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[Silverlight Elements]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1585</guid> <description><![CDATA[With the football finally over (and, going by local press coverage, New Zealand having won), development has been proceeding apace at Mindscape HQ. We&#8217;re hoping to announce a couple of launches in the near future, but in the meantime, here&#8217;s what&#8217;s new in this week&#8217;s nightly builds. Silverlight Elements The MulticolumnTreeView control now supports alternating [...]]]></description> <content:encoded><![CDATA[<p>With the football finally over (and, going by local press coverage, New Zealand having won), development has been proceeding apace at Mindscape HQ.  We&#8217;re hoping to announce a couple of launches in the near future, but in the meantime, here&#8217;s what&#8217;s new in this week&#8217;s nightly builds.</p><p><a
href="http://www.librarything.com/work/12902"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/07/DeveloperNotes.png" alt="" title="Almost entirely about flower-pots" width="344" height="64" class="alignnone size-full wp-image-1586" /></a></p><p><strong>Silverlight Elements</strong></p><ul><li>The MulticolumnTreeView control now supports alternating row colours.</li><li>We&#8217;ve added the new MultiCalendar control to our custom styles.</li></ul><p><strong>LightSpeed</strong></p><ul><li>We&#8217;ve fixed a limitation on eager loading on inheritance hierarchies.  Previously we would only eager load associations declared at or above the level of the queried type.  We now also eager load associations declared on derived types.</li><li>Also on the inheritance theme, we&#8217;ve fixed a bug which resulted in incorrect SQL when a query involved an associated object of a class table inheritance derived type, but the property in the query was declared on a base type rather than the associated type.</li><li>We&#8217;ve fixed an issue which could cause entity settings not to be displayed in the VS2008 designer.</li><li>We&#8217;ve added a way to decouple property and field names.  This can be handy in inheritance scenarios, where a column can mean different things depending on which derived class you&#8217;re in.</li></ul><p>All of these fixes and enhancements are available in the current nightly builds, available from the store or (for free and trial editions) from the downloads page.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F01%2Fnightly-news-2-july-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F07%2F01%2Fnightly-news-2-july-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/07/01/nightly-news-2-july-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 25 June 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/06/24/nightly-news-25-june-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/06/24/nightly-news-25-june-2010/#comments</comments> <pubDate>Thu, 24 Jun 2010 20:09:43 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[Silverlight Elements]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1577</guid> <description><![CDATA[New Zealand has shut down for the day because of the footie &#8212; even our Fearless Leader Mr Trask has taken the day off to watch it. However, his minions soldier on. Here&#8217;s this week&#8217;s batch of fixes and enhancements. Silverlight Elements We&#8217;ve added a new MultiCalendar control to Silverlight Elements, which allows you to [...]]]></description> <content:encoded><![CDATA[<p>New Zealand has shut down for the day because of the footie &#8212; even our Fearless Leader Mr Trask has taken the day off to watch it.  However, his minions soldier on.  Here&#8217;s this week&#8217;s batch of fixes and enhancements.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes21.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes21.png" alt="" title="Wait, the whole *day*?  I thought only cricket lasted for whole days?" width="344" height="64" class="alignnone size-full wp-image-1580" /></a></p><p><strong>Silverlight Elements</strong></p><p>We&#8217;ve added a new MultiCalendar control to Silverlight Elements, which allows you to display multiple months and select multiple dates, either as a range or as multiple dates or ranges.</p><p><strong>LightSpeed</strong></p><p>We&#8217;ve made several improvements around joins this week.  You can now use multiple criteria in joins, and in LINQ you can conveniently express this by using an anonymous type as the join argument.  We&#8217;ve also added some support for querying on through associations.</p><p>We&#8217;ve also provided a way to resize entities vertically in the designer, for those cases where you have an entity with very few properties but lots of associations.  Vertical resizing isn&#8217;t turned on by default because it can impair usability, but if you have entities like this then you can <a
href="http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=3296&#038;PostID=10992">read about the secret squirrel trick here</a>.</p><p>Finally, we&#8217;ve released a number of minor fixes and tweaks:</p><ul><li>Auto through entities weren&#8217;t being given the right identity type when creating the database tables in the designer.</li><li>We now allow migrations projects to be in solution folders rather than requiring them to be at the root.</li><li>We&#8217;ve fixed an issue where the designer custom template path wasn&#8217;t being shown for editing if the .lsmodel file was in a subfolder.  We&#8217;ve also fixed an issue with missing projects in a solution.</li><li>Fixed support for the Visual Basic LINQ Group &#8230; By syntax.</li><li>Some fixes for .Equals support in LINQ expressions.</li><li>We have added partial support for discriminated derived types in assemblies other than the one which defines the base type.  This only works in limited situations though &#8212; if you&#8217;ve got a more complex assembly arrangement then let us know.</li><li>Fix for the designer not ignoring transient properties when creating a new database table.</li></ul><p>As always, you can get the latest nightly builds from the <a
href="https://www.mindscape.co.nz/store/myaccount.aspx">My Account page in the store</a>.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F24%2Fnightly-news-25-june-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F24%2Fnightly-news-25-june-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/06/24/nightly-news-25-june-2010/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Many to many associations and composite keys in LightSpeed</title><link>http://www.mindscape.co.nz/blog/index.php/2010/06/17/many-to-many-associations-and-composite-keys-in-lightspeed/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/06/17/many-to-many-associations-and-composite-keys-in-lightspeed/#comments</comments> <pubDate>Thu, 17 Jun 2010 22:32:55 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[General]]></category> <category><![CDATA[LightSpeed]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1550</guid> <description><![CDATA[In LightSpeed, we model many-to-many relationships using through associations. Each instance of the many-to-many relationship is represented by an instance of a through entity, which usually has little more than references to the two entities it&#8217;s relating. For example, suppose we have employees and projects: an employee can work on many projects, and a project [...]]]></description> <content:encoded><![CDATA[<p>In LightSpeed, we model many-to-many relationships using through associations.  Each instance of the many-to-many relationship is represented by an instance of a through entity, which usually has little more than references to the two entities it&#8217;s relating.</p><p>For example, suppose we have employees and projects: an employee can work on many projects, and a project can be worked on by many employees.  So we would have a through association between the Employee and Project entities, and a through entity type to support it, typically called something like EmployeeProject.  Each EmployeeProject has references to one Employee and one Project.  Plus, because an EmployeeProject is an entity, it has an ID.</p><p>So far, so good.  But a common idiom at the database level is to say, &#8220;Well, hang on.  An EmployeeProject is uniquely identified by its EmployeeId and ProjectId.  Why are we wasting precious bytes on an ID?  Why don&#8217;t we make EmployeeId and ProjectId a composite primary key?&#8221;</p><p>Well, the answer to that is, &#8220;Because it will make your life harder.&#8221;  LightSpeed 3 supports composite keys, but they&#8217;re not as easy to work with as surrogate keys.  And until recently LightSpeed hasn&#8217;t been able to use an ID as the key for an association, so it&#8217;s required hand-coded workarounds to realise the association.  So if you have the option, it&#8217;s just easier to use the separate ID column.</p><p>But if the through table already exists and uses the composite primary key, then this option may not be available to you.  In which case, how do you work with the composite key and the associations that use parts of the composite as their foreign keys?</p><p>The answer comes in two parts &#8212; the first part is standard LightSpeed composite key handling, and the second is a new mapping feature in LightSpeed 3.1.</p><p><strong>1. Defining the Through Entity With a Composite Key</strong></p><p>Our through entity is going to have a composite key consisting of the EmployeeId and ProjectId.  We&#8217;ve previously discussed <a
href="http://www.mindscape.co.nz/blog/index.php/2009/12/22/composite-keys-in-lightspeed-3/">how to define such a composite key in code</a>.  You can also create it in the designer by just dragging the table onto the design surface.</p><p>You&#8217;ll also need to override the GeneratedId() method to tell LightSpeed how to assign composite key values.  This is discussed in the linked article.</p><p>You can now set up the one-to-many associations from Employee and Project to the through entity, and the through association between the Employee and Project classes.  Here&#8217;s how it looks in the designer at this stage.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/lsmd-through-assoc-ck-model.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/lsmd-through-assoc-ck-model.png" alt="" title="Through association with composite keyed through entity" width="591" height="322" class="alignnone size-full wp-image-1558" /></a></p><p><strong>2. Backing the Associations onto the Composite Key</strong></p><p>At this point, we still have a problem with our one-to-many associations.  When LightSpeed sees an association called Employee, it also expects to see an EmployeeId property to hold the foreign key value.  It expect this so much that the designer automatically creates this property for you.  Trouble is, we don&#8217;t want that property, because in our case the foreign key value is the EmployeeId part of the composite key.</p><p>To tell LightSpeed to back the Employee association onto some other property rather than the automatic EmployeeId property, we use the <em>Key Property Reference</em> setting.  Key Property Reference tells LightSpeed to use an existing property as the foreign key store, rather than the automatic property.  The important thing for our composite key scenario is that Key Property Reference supports subproperties.  So if we put &#8220;Id.EmployeeId&#8221; as the Key Property Reference, LightSpeed will use the EmployeeId property of the composite Id as the foreign key.  Which is exactly what we need.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/lsmd-through-assoc-ck-mapping.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/lsmd-through-assoc-ck-mapping.png" alt="" title="Mapping the association foreign key to the composite key field" width="585" height="417" class="alignnone size-full wp-image-1559" /></a></p><p>(To do this in code, apply the ForeignKeyFieldAttribute to the EntityHolder field.  The same path applies in both cases.)</p><p>We need to do a similar mapping on the EmployeeProject.Project association, setting the Key Property Reference in this case to Id.ProjectId.</p><p>And we&#8217;re done!  Our through entity now supports many-to-many associations between Employees and Projects without the need for an additional surrogate key.</p><p>To reiterate, you&#8217;ll usually use this technique only with legacy databases that you can&#8217;t change.  If you have the choice, it&#8217;s much easier to have a separate Id column for all of your entities, including through entities.  But if you need to work with an existing database that uses foreign keys as primary keys, Key Property Reference and the ForeignKeyField attribute are the way to do it!</p><p>Want to know more? <a
href="http://www.mindscape.co.nz/products/lightspeed/thanks.aspx">Download the free LightSpeed Express edition</a> and try it out!</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F17%2Fmany-to-many-associations-and-composite-keys-in-lightspeed%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F17%2Fmany-to-many-associations-and-composite-keys-in-lightspeed%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/06/17/many-to-many-associations-and-composite-keys-in-lightspeed/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Nightly news, 18 June 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/06/17/nightly-news-18-june-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/06/17/nightly-news-18-june-2010/#comments</comments> <pubDate>Thu, 17 Jun 2010 21:23:24 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[WPF Elements]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1546</guid> <description><![CDATA[Here it is, all the new hotness from the Mindscape forge&#8230; WPF Elements We&#8217;ve been continuing to enhance WPF Elements with some of the controls from our Silverlight Elements suite. Since the last bulletin we&#8217;ve added: SplitButton DualSlider OutlookBar These controls are available in the current nightly build &#8212; check them out! We&#8217;ve also fixed [...]]]></description> <content:encoded><![CDATA[<p>Here it is, all the new hotness from the Mindscape forge&#8230;</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes2.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes2.png" alt="" title="Number nine" width="344" height="64" class="alignnone size-full wp-image-1547" /></a></p><p><strong>WPF Elements</strong></p><p>We&#8217;ve been continuing to enhance WPF Elements with some of the controls from our Silverlight Elements suite.  Since the last bulletin we&#8217;ve added:</p><ul><li>SplitButton</li><li>DualSlider</li><li>OutlookBar</li></ul><p>These controls are available in the current nightly build &#8212; check them out!</p><p>We&#8217;ve also fixed a bug where the IntegerTextBox.ValueChanged event was getting declared incorrectly.</p><p><strong>LightSpeed</strong></p><ul><li>The DateTime.Date property is now supported in LINQ queries on SQL Server 2008.  (It&#8217;s been supported on Oracle and PostgreSQL since 2.2.)</li><li>We&#8217;ve made some further tweaks in support of .NET Remoting.</li><li>We&#8217;ve made a number of bug fixes around class table inheritance, including some fixes for incorrect joins and aliasing, and an error where the schema wasn&#8217;t being respected on derived classes.</li></ul><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F17%2Fnightly-news-18-june-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F17%2Fnightly-news-18-june-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/06/17/nightly-news-18-june-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 11 June 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/06/10/nightly-news-11-june-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/06/10/nightly-news-11-june-2010/#comments</comments> <pubDate>Thu, 10 Jun 2010 23:33:28 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category> <category><![CDATA[Silverlight Elements]]></category> <category><![CDATA[WPF Elements]]></category> <category><![CDATA[WPF Property Grid]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1541</guid> <description><![CDATA[Lots of stuff going on at Mindscape HQ right now, but we&#8217;ve found time to deliver a few enhancements and bug fixes in the last week&#8217;s worth of nightly builds. Here&#8217;s the goodness. WPF Elements We&#8217;ve started porting some of the cool controls from Silverlight Elements to WPF, and the following are done and included [...]]]></description> <content:encoded><![CDATA[<p>Lots of stuff going on at Mindscape HQ right now, but we&#8217;ve found time to deliver a few enhancements and bug fixes in the last week&#8217;s worth of nightly builds.  Here&#8217;s the goodness.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes1.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes1.png" alt="" title="The walrus was Paul!" width="344" height="64" class="alignnone size-full wp-image-1542" /></a></p><p><strong>WPF Elements</strong></p><p>We&#8217;ve started porting some of the cool controls from Silverlight Elements to WPF, and the following are done and included in the current nightly build of WPF Elements:</p><ul><li>DualProgressBar</li><li>TimePicker</li><li>TimeSpanPicker</li></ul><p>Other controls will be arriving in future nightlies &#8212; we expect to make a proper announcement next week.</p><p><strong>LightSpeed</strong></p><ul><li>We&#8217;ve added some checking to the designer to provide a more meaningful warning if you create an association to a concrete table inheritance base class.</li><li>Fixed a problem with validation when using .NET remoting.</li><li>Fixed a designer bug which prevented you from using the tree view to add CLR attributes.</li><li>We&#8217;ve fixed a problem in optimistic concurrency checking where version information was being updated on a failed save.  This fixes a related issue which could result in concurrency checking being fooled by repeated save attempts.</li><li>Updated SQLite provider to version 1.0.66.</li></ul><p><strong>Silverlight Elements</strong></p><ul><li>The RichTextEditor now supports changing the background colour.</li></ul><p><strong>WPF Property Grid</strong></p><ul><li>Fixed an issue with dangling event handlers which could cause memory leaks or errors in collection scenarios.</li></ul><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F10%2Fnightly-news-11-june-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F10%2Fnightly-news-11-june-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/06/10/nightly-news-11-june-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Nightly news, 4 June 2010</title><link>http://www.mindscape.co.nz/blog/index.php/2010/06/03/nightly-news-4-june-2010/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/06/03/nightly-news-4-june-2010/#comments</comments> <pubDate>Fri, 04 Jun 2010 02:24:15 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1537</guid> <description><![CDATA[Another quiet week on the fixes and enhancement front: here&#8217;s what we&#8217;ve delivered in this week&#8217;s nighty builds. LightSpeed Designer support for nullable stored procedure arguments Fix for a LINQ issue using logical expressions involving nullable properties from Visual Basic In other news, Jason has been forging ahead on WPF Diagramming 2.0, and it&#8217;s shaping [...]]]></description> <content:encoded><![CDATA[<p>Another quiet week on the fixes and enhancement front: here&#8217;s what we&#8217;ve delivered in this week&#8217;s nighty builds.</p><p><a
href="http://twitter.com/traskjd/statuses/15302026759"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/06/DeveloperNotes.png" alt="" title="Friday afternoon and too warm to think.  Gag FAIL" width="344" height="64" class="alignnone size-full wp-image-1538" /></a></p><p><strong>LightSpeed</strong></p><ul><li>Designer support for nullable stored procedure arguments</li><li>Fix for a LINQ issue using logical expressions involving nullable properties from Visual Basic</li></ul><p>In other news, Jason has been forging ahead on WPF Diagramming 2.0, and it&#8217;s shaping up to be a very nice release with lots of cool new features.  Thanks to everyone who provided feedback and suggestions!</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F03%2Fnightly-news-4-june-2010%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F06%2F03%2Fnightly-news-4-june-2010%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/06/03/nightly-news-4-june-2010/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Large models in LightSpeed 3.1 &#8211; Part 2</title><link>http://www.mindscape.co.nz/blog/index.php/2010/05/31/large-models-in-lightspeed-3-1-part-2/</link> <comments>http://www.mindscape.co.nz/blog/index.php/2010/05/31/large-models-in-lightspeed-3-1-part-2/#comments</comments> <pubDate>Mon, 31 May 2010 23:50:12 +0000</pubDate> <dc:creator>Ivan Towlson</dc:creator> <category><![CDATA[LightSpeed]]></category><guid
isPermaLink="false">http://www.mindscape.co.nz/blog/?p=1501</guid> <description><![CDATA[In a previous post, I talked about some of the issues that arise when you want to work on a large model in a visual designer, and some enhancements in LightSpeed 3.1&#8242;s filtered views feature to get around those issues. However, a model with filtered views is still a monolithic model. Sometimes you want to [...]]]></description> <content:encoded><![CDATA[<p>In a <a
href="http://www.mindscape.co.nz/blog/index.php/2010/05/26/large-models-in-lightspeed-3-1-part-1/">previous post</a>, I talked about some of the issues that arise when you want to work on a large model in a visual designer, and some enhancements in LightSpeed 3.1&#8242;s filtered views feature to get around those issues.  However, a model with filtered views is still a monolithic model.  Sometimes you want to be able to split your model across multiple files.  In a large system, for example, you don&#8217;t want the model file to become a bottleneck: it&#8217;s useful for multiple developers to be able to work on different parts of the model at the same time.  It&#8217;s also good discipline to try to partition the model up into discrete subsystems so as to minimise coupling between those subsystems: this allows the subsystem models to evolve independently as requirements change and the domain is modelled in more detail or needs to reflect changes in the real world.</p><p>For example, in an order fulfilment model you might identify three major areas: orders, logistics and customers.  Each of these areas has a potentially complex internal model, but has relatively few links to the other areas.  They&#8217;re not completely isolated, of course: a customer has orders, an order has shipments.  But they can be developed independently: you can refine the way warehousing is modelled without having to muck around with the way orders or customers are modelled; and conversely things in the orders or customers sub-domains may care about shipments, but probably don&#8217;t care about anything deeper in the logistics domain.</p><p>In LightSpeed 3.1, you can represent a semi-partitioned domain like this using <em>linked model files</em>.</p><p>The pattern of internal cohesion with relatively few external links is characteristic of a good sub-domain, and it&#8217;s the key to using linked models.  Linked models need some external references &#8212; otherwise there&#8217;s be no point linking them! &#8212; but you want to minimise these, so that each linked model is as standalone as possible.  Otherwise you end up having to jump between models to make changes, which cancels out the simplicity benefits of splitting the big model in the first place.  Thus, in this example, we&#8217;d create three linked model files: Orders.lsmodel, Logistics.lsmodel and Customers.lsmodel.</p><p>With linked model files, we can represent each sub-domain in its own file, with entities that are defined in other files but needed for associations represented as <em>entity links</em>.  Here&#8217;s how it looks:</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-logistics.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-logistics-600x359.png" alt="" title="Linked models example: the logistics sub-model" width="600" height="359" class="alignnone size-medium wp-image-1522" /></a></p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-orders.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-orders-600x360.png" alt="" title="Linked models example: the orders sub-model" width="600" height="360" class="alignnone size-medium wp-image-1523" /></a></p><p>Notice how PurchaseOrder in the Orders sub-model is able to link to Customer in the Customers sub-model and Shipment in the Logistics sub-model via entity links to the Customer and Shipment entities:</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-linkage.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-linkage-600x269.png" alt="" title="Cross-file associations and linked entities" width="600" height="269" class="alignnone size-medium wp-image-1524" /></a></p><p><strong>How do I link model files?</strong></p><p>A LightSpeed designer model has a Name property, which you can see and edit by clicking on the model background and going to the Properties window.  Two models with the same Name are linked.  It&#8217;s that easy.</p><p><strong>Really?  It&#8217;s that easy?</strong></p><p>Well, it&#8217;s <em>almost</em> that easy.  There are a couple of extra rules.  First, the Target Namespace settings of the models must also be the same.  Most people leave the Target Namespace as the project namespace, so you don&#8217;t normally need to do anything here.  Second, all but one of the linked files must have Is Linked Child set to True.  It doesn&#8217;t really matter which one is the &#8220;parent&#8221; &#8212; it&#8217;s just that there&#8217;s some code that we have to generate once and once only, so we have to pick a file to host that once-only code.</p><p>But apart from those two wrinkles, it&#8217;s that easy.</p><p><strong>Couldn&#8217;t you make it any easier?</strong></p><p>Sure.  If you&#8217;ve got a model which is starting to get a bit on the bulky side, you can right-click a one-to-many association that divides the model in two and choose Refactor > Split Model at Association.  (If there&#8217;s no one single association which splits the model in two, you can select multiple one-to-many associations which between them split the model in two.)  Enter the name of the new file, choose which half of the model you want to move into the new file, and Bob&#8217;s your uncle.  The new file will automatically be given the same model name and target namespace as the &#8220;parent&#8221; file, and will be set as a linked child.</p><p>Also, if you use the Paste as Link command to create an entity link, it will check that the two files are linked, and offer to link them if they&#8217;re not.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-split-at-association.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-split-at-association-600x444.png" alt="" title="Splitting a large model into two linked models" width="600" height="444" class="alignnone size-medium wp-image-1525" /></a></p><p><strong>So I have my linked files.  How do I make a model that spans them?</strong></p><p>As discussed above, linked models work best when there are relatively few associations that span files.  If you have too many associations that span files, then you&#8217;ve not got good isolation between your sub-domains, and you&#8217;re likely to have to alter multiple files to make any change.  But of course you need to be able to create <em>some</em> associations that span files.  Here&#8217;s how.</p><p>First, identify the two entities you want to associate.  Let&#8217;s say you want to model that an Order has a collection of Shipments.  Order is defined in Orders.lsmodel and Shipment in Logistics.lsmodel.</p><p>Second, copy each of those entities in turn, and use the new Paste as Link command to paste a link to that entity into the other file.  For example, select the Shipment entity in Logistics.lsmodel, press Ctrl+C to copy it to the Clipboard, switch to Orders.lsmodel, right-click the background and choose Paste as Link.  You&#8217;ll see an entity link appear in Orders.lsmodel &#8212; you can tell it apart from a normal entity because it has a link icon and says &#8220;Link to&#8221; in its descriptive text.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-paste-as-link.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-paste-as-link.png" alt="" title="Paste as Link screenshot" width="577" height="379" class="alignnone size-full wp-image-1526" /></a></p><p>Now do the same operation in reverse, copying the Order entity from Orders.lsmodel and pasting it as a link into Logistics.lsmodel.</p><p>Third, create the association in <em>both</em> files.  In each case, you create the association normally, by selecting OneToManyAssociation from the toolbox and dragging an arrow from Order to Shipment.  But you need to do it twice: once in Orders.lsmodel and once in Shipment.lsmodel.</p><p>Save the files and you&#8217;ll now find that your Order class includes a Shipments property and your Shipment class includes an Order property!  Of course you can rename the ends of the association and set properties as usual &#8212; just remember to do it in both places.</p><p><strong>Man, that&#8217;s like <em>fourteen</em> clicks.</strong></p><p>I warned you!  Cross-file associations aren&#8217;t as convenient as intra-file associations.  If you&#8217;re having to create a lot of them, maybe you should be splitting your model in a different place.  Or maybe linked models aren&#8217;t a good fit for your problem domain.</p><p><strong>Yeah, but <em>fourteen clicks</em>.  I&#8217;m a busy guy.  Minesweeper doesn&#8217;t play itself, you know.</strong></p><p>A lot of models are evolutionary: that is, rather than creating three .lsmodel files on day one, you&#8217;ll start out with a single .lsmodel file, and break it up about the eighteenth time someone else asks you when you&#8217;ll be finished with it.  When this happens, you can use the Refactor > Split Model at Association command to partition the model.  This will create the necessary links and &#8220;duplicate&#8221; associations.  Three clicks and a few keystrokes.</p><p>We&#8217;ll also be working to improve this experience in future nightly builds.</p><p><strong>Anything else I need to watch out for when using cross-file associations?</strong></p><p>It&#8217;s important to realise that entity links aren&#8217;t really links &#8212; they&#8217;re more like references, and they can get out of date.  If you change, say, the identity type of the entity, you need to update the links to that entity to reflect that change.  Similarly if you have a cross-file association and you change its properties, you need to change them in both places.</p><p>Fortunately, LightSpeed does give you a bit of help with this.  You can right-click a linked model and choose the Check Links command to verify that links and associations are up-to-date.  For some inconsistencies, LightSpeed can fix the problem automatically: we can&#8217;t yet do this for all inconsistencies, but again it&#8217;s something we plan to improve in the nightly builds.</p><p><a
href="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-fix-em-up.png"><img
src="http://www.mindscape.co.nz/blog/wp-content/uploads/2010/05/lsmd-linked-models-fix-em-up-600x302.png" alt="" title="Fixing inconsistencies in a linked model set" width="600" height="302" class="alignnone size-medium wp-image-1527" /></a></p><p><strong>Where can I get it?</strong></p><p>Linked models are supported in all editions of LightSpeed 3.1, in both Visual Studio 2008 and Visual Studio 2010.  If you&#8217;re a customer, <a
href="http://www.mindscape.co.nz/store/myaccount.aspx">LightSpeed 3.1 is in the store now</a>.  If you&#8217;re not&#8230; well, normally at this stage I&#8217;d exhort you to <a
href="http://www.mindscape.co.nz/products/lightspeed/thanks.aspx">download the free Express edition</a> and give it a try, but the free Express edition is limited to eight entity types, which hardly counts as large model territory.  But what the heck.  We think this is a pretty handy feature for dealing with large models, and we&#8217;d love to hear your feedback on how we can improve it.  So go ahead: <a
href="http://www.mindscape.co.nz/products/lightspeed/thanks.aspx">download it anyway</a>.</p><div
class="tweetmeme_button" style="float: right; margin-left: 10px;"><a
href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F05%2F31%2Flarge-models-in-lightspeed-3-1-part-2%2F"><img
src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.mindscape.co.nz%2Fblog%2Findex.php%2F2010%2F05%2F31%2Flarge-models-in-lightspeed-3-1-part-2%2F" height="61" width="51" /></a></div>]]></content:encoded> <wfw:commentRss>http://www.mindscape.co.nz/blog/index.php/2010/05/31/large-models-in-lightspeed-3-1-part-2/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (request URI is rejected)

Served from: www.mindscape.co.nz @ 2010-07-29 11:31:37 -->