Questions tagged [loose-coupling]

207 questions
4
votes
9 answers

Do you define an interface for every public class in your domain model? Pros and Cons?

Do you implement an interface for every public class in your domain model? Pros and Cons? Update: If Repositories interfaces and domain model classes are defined in separate assemblies, wouldn't there be circular dependency if we do not define…
StackUnderflow
  • 24,080
  • 14
  • 54
  • 77
4
votes
4 answers

Help with program design

I'm currently creating a simple console-based game in which the player can move between different rooms, pick up and use items, and eat food. In the game's current state that's about it. What I need help with is: Creating a good "Event" class for my…
bjrnt
  • 2,552
  • 3
  • 27
  • 38
4
votes
1 answer

What is the right way to do "loose coupling" in python?

I wrote some code to get data using pySerial as below. My class is depend on serial class which doesn't meet the "loose coupling" rule. Should I use interface to decouple my class? Thanks a lot for your instruction. import serial class…
4
votes
1 answer

java Loose Coupling avoid using implemnetation types like 'ArrayList'; Use the interface instead

WE have this app for coding standards called Sonar. I have this one function that returns an ArrayList and sonar is says "java Loose Coupling avoid using implemnetation types like 'ArrayList'; Use the interface instead" For example if i do this,…
user1158745
  • 2,402
  • 9
  • 41
  • 60
4
votes
7 answers

What are the best tools for Loose Coupling in C#

I was reading Loose Coupling and its benefits which are really good stuff but I started wondering which tools are great to create loosely-coupled solutions ? First what came to my mind are Type and Interfaces and Abstract classes but I am sure there…
Tarik
  • 79,711
  • 83
  • 236
  • 349
4
votes
1 answer

Mediator/EventAggregator differences

Also, when i need to communicate between loosely coupled objects (for example, MVVM's ViewModel's), different books and blogs about best programming practices suggest use Mediator/EventAggregator patterns. My question is about differences/relations…
Dzmitry Martavoi
  • 6,867
  • 6
  • 38
  • 59
4
votes
3 answers

How to make the framework and the dependent applications loosely coupled?

I have a specific case and I want to know the best practice way to handle it. I make a specific .NET framework (web application). This web application acts like a platform or framework to many other web applications through the following methodology…
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
3
votes
2 answers

Loose coupling NativeMethods

I need to use a native DLL from C#. The DLL exposes several methods which I can access via P/Invoke, and several types. All this code is in a standard NativeMethods class. To keep things simple it looks like this: internal static class…
Suiden
  • 622
  • 4
  • 17
3
votes
2 answers

AS3 central event dispatcher shared between instances (not static)

I'm building a flash app (just AS3 with FlashDevelop) and I'm having some trouble keeping things loosely coupled around the event system. I've done a lot of reading about central event systems and static eventdispatchers but they don't quite fit…
Ryan Bosinger
  • 1,832
  • 2
  • 16
  • 25
3
votes
2 answers

.NET REST services, Entity Framework and loose coupling

I'm working on a web application project using ASP.NET MVC3 and database in SQL Server. There is also a mobile application that uses the data from the same database via REST services. Here are some of my application's layers: Model - ADO.NET Data…
Nebojsa Veron
  • 1,545
  • 3
  • 19
  • 36
3
votes
2 answers

Loose coupling via using only primitive types / delegates

I have a conceptual / theoretical question about loose coupling and interfaces. So one way to use an interface might be to encapsulate the parameters required by a certain constructor: class Foo { public Foo(IFooInterface foo) { // do…
Sean Thoman
  • 7,429
  • 6
  • 56
  • 103
3
votes
5 answers

What are some of the things to watch for (pitfalls) while using IOC container?

What are some of the things to watch for (pitfalls) while using IOC container?
3
votes
1 answer

loose coupling example

intro code: public interface Course { /** * returns the number of units (hours) a specific course is */ public int units(); /** * returns the number of students signed up for the course */ public int…
davin
  • 44,863
  • 9
  • 78
  • 78
3
votes
3 answers

Why is returning a Iterator low coupling (OOP)?

So I heard today that returning a iterator is a better solution (low coupling/loose coupling), than returning a arraylist. I have an arraylist of items, I have a getter for this arraylist, and was wondering why is getting a iterator a better…
CookieMonster
  • 241
  • 1
  • 9
  • 26
3
votes
1 answer

Chain of Responsibility VS Case statements

When I read about Chain of Responsibility, it talks about separating the client from the actual processing of the data. So it says the client program calls the first member of a chain and that member determines if it can process the request and if…
1 2
3
13 14