473,498 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Late-Binding: the only way to DIP?

I have 3 C#.NET assemblies:

Assembly A: Calls methods of Assembly C, which implements an interface in
Assembly B, therefore, must reference both B and C (unless late binding is
used)

Assembly B: Contains the interface implemented by C, and also referenced by
A

Assembly C: Implements interface located in Assembly B

So, now A is dependent on C (and everything C is dependent on), even though
it is only treated as a B, for example:

in B: (the interface)

public interface Runner {
void Run();
}

in C: (the implementation)

public class RunnerImp : Runner {
public void Run() {
Console.Write("Running");
}
}

in A: (the dependency I want to avoid)

class Engine {
Runner myRunner = new RunnerImp();
myRunner.Run();
}

So, even though I tried to do DIP, I failed.

How to get around this dependency without doing late-binding (using
Activator class) to RunnerImp class?

Use of abstract factory has been suggested, but it seems to me that I still
depend on the abs factory, which then depends on the concrete factory, which
then depends on the concrete product and all it's dependencies (actually, on
all the concrete products' dependencies). I thought there might a way around
this? Or am I trying to do something that isn't possible?

Thanks.

Nov 15 '05 #1
0 1478

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1767
by: Porky | last post by:
Scenario: login/logoff scripts that kick username, times, and dates out to a CSV file. I have a linked table in access pointing to that CSV file. Users typically log in and log out twice a day...
0
2255
by: MarionEll | last post by:
--------------------------------------------------------- ************* Call for Participation ************** ************ Late Breaking News ************* *********** Extreme...
0
1641
by: MarionEll | last post by:
XML Conference 2003 program now available…register with discounts now! IDEAlliance has just released the full program for XML 2003 scheduled December 7-12 at the Philadelphia Convention Center....
0
1541
by: melledge | last post by:
Deadline for XTECH 2005 Late-Breaking News and Vendor Presentations - 28 March The deadline for submission of Late-Breaking News and Vendor Presentations for IDEAlliance's XTCH 2005...
2
4334
by: hazz | last post by:
how do I do this? I am certain my Visual Studio .NET solution allowed me to do this before but I don't know how the build/debug settings were configured. In order to get around an unavoidable...
1
2000
by: Daniel | last post by:
How do I call a delegate in late bound C# dll? there some way to do this w/ a sharedinterface file? any examples? i tried this but it doesnt work: (oType.GetMethod("IOCTLJOB").Invoke(pObj, new...
5
2786
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped...
32
2625
by: whiteboy | last post by:
What's up Everyone? I really need some help. I've been pulling the hair out of my head trying to research how to calculate a late date. Here is what I'm trying to do: DATE VOUCHER...
1
1510
snowman67
by: snowman67 | last post by:
I am writing an RFQ for a software to support my alternativecancer.us web site and need to add a late clause. I haven’t seen any, but I was thinking of a 1% penalty for the first week late and...
13
2443
by: Wayne | last post by:
I have just experienced my first late paying client. By "late" I mean that the invoice is now almost 2 months overdue. I don't think that the client is maliciously withholding payment - rather...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.