Dean, 
 
Thanks for your guidance. It was very enlightening to see the confusion in my 
ways. 
 
I will redo my design so that reference dependencies go in one direction. My 
error was that I was expecting the core assembly do something with the sub 
assemblies that the web application should be doing instead. 
 
After for years developing everything in dreamweaver with straight code, I'm 
finally begginning to use VS.NET to build assemblies that house core and 
reusable logic. It's hard for me to treat VS.NET as something more than a 
well-featured text editor. I will definitely look into the build events and 
batch files. I also think I need to understand Reflection better. 
 
Thanks again,
 
M.
 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf 
Of Dean Fiala
Sent: Wednesday, October 12, 2005 12:41 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] Assembly/Class Library/Reference tough 
challenge!!


You're getting yourself into a circular reference problem, you should
rethink your design so your reference dependencies go in one
direction.  You say you want "loosely-coupled" assemblies, but then
you want to reference these in the core assembly, which makes them no
longer loosely coupled. You're getting the worst of both worlds -- the
rigidness of a monolithic app with  the maintenance overhead of a
modular architecture.

Allowing VS.NET's ability to fill your /bin with all the needed
assemblies to drive your architecture decisions is curious to say the
least.  Especially since moving files to the bin directory is easily
done manually and can be easily automated as well.  For C# projects
you can use the post-build event
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscon/html/vcurfcustombuildeventscommonpropertiesprojectnamepropertypagesdialogbox.asp).
For all projects you can use batch files or an automated build tool
such as nant (http://nant.sourceforge.net/).

You can still call sub-assemblies from the core assembly, you simply
need to know the interfaces of the classes you want to call.  One way
to do this is if the sub-assemblies inherit from base classes or
implement interfaces defined in the core assembly, then you simply
dynamically load the class from the sub assembly and call the method.

Here's a simple example...

  Dim ub As UpdaterBase
  Dim t As Type
  Dim a As [Assembly]

     'load the sub-assembly dynamically
     a = [Assembly].LoadFile(DynamicUpdateFile)

    'create an instance of a class that inherits from UpdaterBase
     ub = a.CreateInstance(a.GetName.Name & ".UpdaterImplementation")

    'call the method on the class in the sub-assembly
    ub.Update()


You can also use reflection
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconReflectionOverview.asp)
to call any method in any class
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemreflectionmethodbaseclassinvoketopic.asp).





On 10/11/05, Matías Niño ListMail <[EMAIL PROTECTED]> wrote:
> Hey guys!
>
> Using VS.NET 2003, I'm trying to create an assembly (as a class library) that 
> forms as a core framework for all the web apps I build.
>
> Moreover, I want to build sub 'modules' in separate class libraries as 
> sub-assemblies that are loosely coupled with the core assembly.
>
> Here's my folder structure
>
> /webapproot/     (Core assembly Class Library project file location)
> /webapproot/bin     (compiled Core assembly location)
> /webapproot/modules/modulename/     (Module assembly Class Library project 
> file location)
> /webapproot/modules/modulename/bin     (Module assembly location)
>
>
> Things to note:
>     -I'm prohibited from using the GAC
>     -module directory cannot be a virtual web directory
>     -The VS class library projects are stored and worked on from within the 
> respective directories such that the assembly directly compiles into the bin 
> subdirectory.
>
> The problem I'm having is I need to reference the core assembly in the sub 
> assembly (via adding a reference in VS.NET) because the sub assembly inherits 
> some base classes in the core assembly. But I also want to reference the sub 
> assembly from within the core assembly so that I can call functions from the 
> core assembly. When I do this, the core assembly won't compile claiming an 
> inconsistency in version numbers. This only happens when both assemblies 
> reference each other.
>
> But I like referencing the sub assembly from the core assembly because when I 
> compile, it automatically copies over the sub-assembly into the webroot's bin 
> directory and I can test the web app immediately.
>
> Anyone have any idea how I can solve this problem in a very simple way?
>
> Thanks in advance for any thoughts or alternatieve solutions!
>
> M.
> Manassas, VA
> c: 703/855/5576
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>


--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com



SPONSORED LINKS 
Basic programming language 
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
         Computer programming languages 
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
         Programming languages 
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ>
   
Java programming language 
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
   

________________________________

YAHOO! GROUPS LINKS 


        
*        Visit your group "AspNetAnyQuestionIsOk 
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
          
*        To unsubscribe from this group, send an email to:
         [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
          
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 


________________________________




[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




Reply via email to