By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

How to split a project in many DLL projects

P: n/a
Hi,

I am working on a project that is getting too big and we would like to split
it in many DLLs Projects.
In that way some dlls should be written in C# and some in VB.NET.

The problem we got to do that is that if we cut a part of code from the main
project (Project1) and if we put it in a new DLL project (Project2) it is
not possible to compile Project2 because it need to declare some classes
that are defined in Project1.

To resolve that problem, in project 2 we add a reference to Project1.

But now, because some functions called by Project1 have been moved to
project2, we need to add a reference to project2 in the main project
(project1).

And we got circular references and it is impossible to build the solution
!!!

So what is the correct way to organize an oo project in many DLLs ?

Thanks
Sebastien
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sebastien,
And we got circular references and it is impossible to build the solution
!!! The normal way to avoid circular references between assemblies that require
a circular reference is the Separated Interface Pattern.

http://www.martinfowler.com/eaaCatal...Interface.html

However this is not always as easy as it appears.
The problem we got to do that is that if we cut a part of code from the main project (Project1) and if we put it in a new DLL project (Project2) it is
not possible to compile Project2 because it need to declare some classes
that are defined in Project1. Normally what I do is move the code that both Project1 & Project2 depend on
into Project3.

Then Project1 references both Project2 & Project3, while Project2 references
only Project3.

Normally I call this Project3 MySolution.Framework. What I wind up with is
very little code in Project1 as most of it is in Project2 type assemblies
with all the common stuff in Project3 type assemblies.

If you do not start out organizing you classes into projects from the start,
it can be challenging as you are finding to get classes that have no
dependencies into their own assemblies, I know I've been there.

Hope this helps
Jay

"ABC - Sébastien Beaugrand" <be*******@activebaseconcept.com> wrote in
message news:3f***********************@news.free.fr... Hi,

I am working on a project that is getting too big and we would like to split it in many DLLs Projects.
In that way some dlls should be written in C# and some in VB.NET.

The problem we got to do that is that if we cut a part of code from the main project (Project1) and if we put it in a new DLL project (Project2) it is
not possible to compile Project2 because it need to declare some classes
that are defined in Project1.

To resolve that problem, in project 2 we add a reference to Project1.

But now, because some functions called by Project1 have been moved to
project2, we need to add a reference to project2 in the main project
(project1).

And we got circular references and it is impossible to build the solution
!!!

So what is the correct way to organize an oo project in many DLLs ?

Thanks
Sebastien

Nov 20 '05 #2

P: n/a
Jay,
Thank you for your answer that will really help me.

By

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> a écrit dans le
message de news:uu**************@tk2msftngp13.phx.gbl...
Sebastien,
And we got circular references and it is impossible to build the solution !!! The normal way to avoid circular references between assemblies that

require a circular reference is the Separated Interface Pattern.

http://www.martinfowler.com/eaaCatal...Interface.html

However this is not always as easy as it appears.
The problem we got to do that is that if we cut a part of code from the main
project (Project1) and if we put it in a new DLL project (Project2) it is not possible to compile Project2 because it need to declare some classes
that are defined in Project1.

Normally what I do is move the code that both Project1 & Project2 depend

on into Project3.

Then Project1 references both Project2 & Project3, while Project2 references only Project3.

Normally I call this Project3 MySolution.Framework. What I wind up with is
very little code in Project1 as most of it is in Project2 type assemblies
with all the common stuff in Project3 type assemblies.

If you do not start out organizing you classes into projects from the start, it can be challenging as you are finding to get classes that have no
dependencies into their own assemblies, I know I've been there.

Hope this helps
Jay

"ABC - Sébastien Beaugrand" <be*******@activebaseconcept.com> wrote in
message news:3f***********************@news.free.fr...
Hi,

I am working on a project that is getting too big and we would like to

split
it in many DLLs Projects.
In that way some dlls should be written in C# and some in VB.NET.

The problem we got to do that is that if we cut a part of code from the

main
project (Project1) and if we put it in a new DLL project (Project2) it is not possible to compile Project2 because it need to declare some classes
that are defined in Project1.

To resolve that problem, in project 2 we add a reference to Project1.

But now, because some functions called by Project1 have been moved to
project2, we need to add a reference to project2 in the main project
(project1).

And we got circular references and it is impossible to build the solution !!!

So what is the correct way to organize an oo project in many DLLs ?

Thanks
Sebastien


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.