﻿<?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 » WinForms (How do I?)  » Project Dependency Problem</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 11:40:44 GMT</lastBuildDate><ttl>20</ttl><item><title>Project Dependency Problem</title><link>http://forum.strataframe.net/FindPost22098.aspx</link><description>Here is a layout of my projects (in brief) in my current solution:&lt;br&gt;
&lt;br&gt;
ProjectA (MyApp.ProjectA)&lt;br&gt;
    Form1&lt;br&gt;
    Form2&lt;br&gt;
&lt;br&gt;
ProjectB (Namespace: MyApp.ProjectB)&lt;br&gt;
    Form1&lt;br&gt;
    Form2&lt;br&gt;
    Reports (Folder)&lt;br&gt;
        Report1 (Namespace: MyApp.ProjectB.Reports.Report1)&lt;br&gt;
&lt;br&gt;
ProjectC (Namespace: MyApp.ProjectC)&lt;br&gt;
    BusinessObject1&lt;br&gt;
    BusinessObject2&lt;br&gt;
    BusinessObject3&lt;br&gt;
&lt;br&gt;
ProjectA and ProjectB reference ProjectC (no problems there!).  ProjectB has a reference to ProjectA.  Now, I want to print ProjectB's report from Form1 of ProjectA.  I cannot reference ProjectB in ProjectA...that would cause a circular reference.  What do I do?&lt;br&gt;
&lt;br&gt;
Should I consider moving all reports out of the project that they belong in and create a separate Reports project to store any reports in the application?&lt;br&gt;
&lt;br&gt;
Thanks for the help!!&lt;br&gt;
Bill</description><pubDate>Fri, 27 Feb 2009 07:22:56 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Project Dependency Problem</title><link>http://forum.strataframe.net/FindPost22115.aspx</link><description>I'd love to attend training one day.  I'll do my best to digest what you have provided.  Hopefully, I can get on track quickly with this.  &lt;br&gt;
&lt;br&gt;
Thanks!!&lt;br&gt;
Bill</description><pubDate>Fri, 27 Feb 2009 07:22:56 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Project Dependency Problem</title><link>http://forum.strataframe.net/FindPost22105.aspx</link><description>Welcome to the world of inheritance...and there are a number of ways to go about this.&amp;nbsp; We actually have a section in training where we talk about this.&amp;nbsp; &lt;/P&gt;&lt;P&gt;The situation that you are dealing with is ideal for interfaces.&amp;nbsp; Basically you need to move something up the food chain.&amp;nbsp; So you either need to move classes further upstream...or create interfaces that are further upstream and then implemented on the classes.&amp;nbsp; Then to prevent the circular reference, you type instance references that you are fighting as the interface instead of the actual class.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Interface&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]Public Interface MyInterface&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Define properties&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property IsReady() As Boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Define methods&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function Execute() As Boolean&lt;/P&gt;&lt;P&gt;End Interface[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The Class&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]Public Class MySampleClass&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Implements MyInterface&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Implement the execute method from the interface&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Function Execute() As Boolean Implements MyInterface.Execute&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Do something here&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Define the property and implement the IsReady property of the interface&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private _IsReady As Boolean = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Property IsReady() As Boolean Implements MyInterface.IsReady&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return _IsReady&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set(ByVal value As Boolean)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _IsReady = value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Set&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property&lt;/P&gt;&lt;P&gt;End Class[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Typing the Class as an Interface&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]''' &amp;lt;summary&amp;gt;&lt;BR&gt;''' This class will accept the interface instead of the object instance&lt;BR&gt;''' &amp;lt;/summary&amp;gt;&lt;BR&gt;Public Class AnotherTestClass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Public Sub TestingInterface(ByVal e As MyInterface)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Use the interface&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If e.IsReady Then e.Execute()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;End Class[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Using the Interface Instead of the Instance&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;[codesnippet]Public Class FinalTest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub FinalTest()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim x As New AnotherTestClass()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim y As New MySampleClass()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x.TestingInterface(y)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/P&gt;&lt;P&gt;End Class[/codesnippet]</description><pubDate>Thu, 26 Feb 2009 17:32:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>