coupling

Would you say .Net remoting relies on tight coupling?

我是研究僧i 提交于 2019-12-12 19:49:57
问题 Given that both the client and the server need to know everything about the object being remoted, firstly is this tight coupling, and secondly can .Net Remoting work in any other way? 回答1: Not really answering your question, but if you want to loosen the coupling, you might look at WCF's NETTCP binding as an alternative. The client can create a proxy for the entities - this way you won't need to share any assemblies (notably Entities) between client and server. 来源: https://stackoverflow.com

Loose coupling vs tight coupling of services

蓝咒 提交于 2019-12-12 00:56:49
问题 I understand that we at almost all times want to aim for loose coupling between components within an application & why. But in the below example if someone could clarify as to why it isn't tightly coupled when we pass in a service as a parameter to a constructor so I could understand the logic that's going on under the hood. export class Test(){ dataResults; constructor(service: testService){ this.dataResults = service.getData() } } 回答1: Tight coupling means : Code written is dependent on one

Co-Simulation with Simulink: stepwise execution and interchange of parameters with external application

烈酒焚心 提交于 2019-12-06 13:48:52
问题 I have to realise a coupled simulation with Simulink and an external application (LS-DYNA). The leading simulation is done in Simulink, where I want to implement a function block as following: The interaction is done using the cmd of windows, so the Simulink block should do the following: function [ x,y ] = ExternalSimlation( u,v ) % open the windows cmd and run the external simulation by passing u and v [status,cmdout] = system( 'command for executing the external simulation -u -v');

Most efficient way to build a random permutations list

ぃ、小莉子 提交于 2019-12-06 09:48:01
For a given Collection<Object> aCollection , How do I build an ArrayList<OrderedCouple<Object>> with all possible permutations of couples in aCollection (except self-coupling). For instance, say aCollection is a Set<Team> containing teamA , teamB and teamC , and OrderedCouple is instead a class Game<Team> which constructor receives two team, the host and the guest as arguments. I want to build an ArrayList of all possible Game s between Team s. that is, the ArrayList will be the group {new Game(teamA, teamB), new Game(teamA, teamC), new Game(teamB, teamA), new Game(teamB, teamC), new Game

Integrating Bundles (Related Doctrine 2 Entities) in Symfony 2 and Coupling

夙愿已清 提交于 2019-12-06 09:08:06
问题 As I understand, Bundles is to separate functionality. Suppose I have a UserBundle & a BlogBundle . Then my BlogBundle:Post will have an author field that references UserBundle:User . Doesn't that defeats the purpose of Bundles? I cant swap another UserBundle in? How can I do it a proper way? Or is this the best it can go? 回答1: If you are uncomfortable with those dependencies between bundles (I personally agree with you), you can create your model outside of any bundle. This can be configured

Integrating Bundles (Related Doctrine 2 Entities) in Symfony 2 and Coupling

倖福魔咒の 提交于 2019-12-04 14:29:28
As I understand, Bundles is to separate functionality. Suppose I have a UserBundle & a BlogBundle . Then my BlogBundle:Post will have an author field that references UserBundle:User . Doesn't that defeats the purpose of Bundles? I cant swap another UserBundle in? How can I do it a proper way? Or is this the best it can go? If you are uncomfortable with those dependencies between bundles (I personally agree with you), you can create your model outside of any bundle. This can be configured like so… doctrine_mongodb: document_managers: default: mappings: model: type: annotation dir: %kernel.root

Model Using Modules in Rails Application

牧云@^-^@ 提交于 2019-12-03 18:51:10
问题 I have a model that requires loading external data from an auxiliary source. A number of web services exist that my model can fetch the data from (swappable), but I don't want to create code that will make it difficult to change services (costs significantly differ based on variable and fixed usage and it is likely changing will be required). I would like to create a driver to perform the interaction (and then create further custom drivers if the service requires switching). Unfortunately,

Best practices for creating libraries that use .NET namespaces

久未见 提交于 2019-12-03 09:27:23
问题 Is it bad practice to write a library that defines an interface dependent on another library? I know tight coupling is bad, but does this still apply when using .NET classes? For example, in .NET, if I have a library that returns a Color object, it would force a dependancy on System.Drawing on anything that uses my library. Would I be better off creating my own Color-type class inside my library? 回答1: I distinguish between Volatile and Stable Dependencies . In general, Color looks like a

How should I inherit IDisposable?

ぐ巨炮叔叔 提交于 2019-12-03 08:35:54
问题 Class names have been changed to protect the innocent . If I have an interface named ISomeInterface. I also have classes that inherit the interface, FirstClass and SecondClass. FirstClass uses resources that must be disposed. SecondClass does not. So the question is, where should I inherit from IDisposable? Both of the following options seem less than ideal: 1) Make FirstClass inherit IDisposable . Then, any code that deals with ISomeInterfaces will have to know whether or not to dispose of

Cohesion and Decoupling, what do they represent?

房东的猫 提交于 2019-12-03 00:47:45
问题 What are Cohesion and Decoupling? I found information about coupling but not about decoupling. 回答1: That article from Aaron is very good for understanding, also I'd recommend that you read manning publications Spring in Action book, they give very good examples on how the spring solves that problem it will definitely improve your understanding of this. EDIT : I came accross this in this great book called Growing object oriented software guided by tests : Coupling : Elements are coupled if a