﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Enhancement Requests  » Business Object Constructors</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 03:19:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3765.aspx</link><description>Whenever I write a class with multiple constructors, I like to also create a &lt;EM&gt;ConstructorCommon() &lt;/EM&gt;method that is called from each overloaded constructor.&lt;/P&gt;&lt;P&gt;Obviously, this method is a good place for dropping code in common to each of the overloads.&lt;/P&gt;&lt;P&gt;So I'd like to see the generated SF Business Object classes (those inheriting from &lt;EM&gt;MicroFour.StrataFrame.Business.BusinessLayer&lt;/EM&gt;, specifically) adopt a similar idiom.&lt;/P&gt;&lt;P&gt;This came up for me today as I had to set &lt;EM&gt;PrimaryKeyIsAutoIncremented &lt;/EM&gt;to false on a BO. Not a big deal, but the right place to do it is in the BO constructor, which meant that I had to do it in all three constructors.&lt;/P&gt;&lt;P&gt;Which again three constructors is not overly-taxing to modify, but as the framework grows over time, it's reasonable to assume the BOs will evolve to having more constructors and not fewer, so the leverage of a &lt;EM&gt;ConstructorCommon()&lt;/EM&gt; method would grow over time.&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Mon, 23 Oct 2006 08:24:01 GMT</pubDate><dc:creator>Chris Crabtree</dc:creator></item><item><title>RE: Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3786.aspx</link><description>hehe...I understand.</description><pubDate>Mon, 23 Oct 2006 08:24:01 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3784.aspx</link><description>I wasn't thinking about the right designer. Actually that is where I prefer setting the property for the class. It's an exposed property, and will apply to all created objects from that class. Perfect.&lt;/P&gt;&lt;P&gt;Chalk it up to too much time&amp;nbsp;wearing my executive hat&amp;nbsp;and not enough time in Visual Studio...:)</description><pubDate>Mon, 23 Oct 2006 08:02:20 GMT</pubDate><dc:creator>Chris Crabtree</dc:creator></item><item><title>RE: Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3778.aspx</link><description>I posted a sample of how to do this at this post: &lt;A href="http://forum.strataframe.net/Topic3766-6-1.aspx"&gt;http://forum.strataframe.net/Topic3766-6-1.aspx&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the designer to use I was just referring to the component designer ... you know, double-click on a BO from the solution explorer.&amp;nbsp; It will open up that blank gray screen on the left, but all of the properties for the class will appear within the property sheet.&amp;nbsp; I know you know what I am talking about at this point.&amp;nbsp; When you set a property within this designer it updates the InitializeComponent of that class.&lt;/P&gt;&lt;P&gt;But I think the subclasses BusinessLayer would be a better direction because you would only have to create a single class and all of your BOs would then follow suite after you change the declaration.</description><pubDate>Sun, 22 Oct 2006 11:56:37 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3775.aspx</link><description>Which designer could I use to set that property? The designer for the &lt;EM&gt;instance &lt;/EM&gt;of the class? I guess I could do that, but to me it's part of the class behavior. In other words, would I ever have an instance of this class where PKAutoInc would be set to True. The answer is no, by definition of this class. So while that would work, I then have to remember to set the property everywhere I use an instance of the class...&lt;/P&gt;&lt;P&gt;As far as changing the base type, obviously that would work too, but I need to consider that. I would just create a new derived class from BusinessLayer that has the three constructors calling the base constructors, set PKAutoInc to False there. And then change the base type for my BO to the newly-created type? Then anytime I wanted to have this behavior, I would just point to a new base type?&lt;/P&gt;&lt;P&gt;I could probably live with that, but then if I want another point-specific behavior, do I want to start creating new base types everywhere...not sure where that would take me from a pure design point of view, but like I said, I need to consider it.&lt;/P&gt;&lt;P&gt;Thanks!</description><pubDate>Sun, 22 Oct 2006 11:47:43 GMT</pubDate><dc:creator>Chris Crabtree</dc:creator></item><item><title>RE: Business Object Constructors</title><link>http://forum.strataframe.net/FindPost3773.aspx</link><description>Well, we take the same approach in many cases as well.&amp;nbsp; First of all, is there a reason you did not just use the designer and set the PrimaryKeyIsAutoincrementing property to false?&amp;nbsp; I guess I don't understand why you set this in the constructors.&amp;nbsp; Next, you can subclass a BO and set it one time and all of your future BOs will already have this property set to false.&amp;nbsp; If you'll notice, the inherits or declaration is in the main file and not the partial file.&amp;nbsp; This allows you to change this once and never have to worry about the rebuild of the partial class overwriting this declaration.&lt;/P&gt;&lt;P&gt;I guess my point is that there are a lot of ways to do this without touching the constructor...though you idea is a good one, I just see several other avenues for you to address this as we speak.</description><pubDate>Sun, 22 Oct 2006 11:35:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>