Questions tagged [coupling]

197 questions
0
votes
2 answers

Fast Ruby method / algorithm to pair elements of two arrays

I have two sorted arrays of float numbers (usually 800-1500 elements), size of the two arrays can be different by +-20-30 %. I am looking for a fast method which pick a correspondent pair of all elements of the smaller array from the elements of the…
Konstantin
  • 2,983
  • 3
  • 33
  • 55
0
votes
2 answers

Coupling and dependencies clarification

I'm currently learning about coupling and dependencies in Java. I've been reading this tutorial and understand that if class1 contains an instance of class2 and if you call a method like exampleMethod(c2), this counts as dependency between class1…
SonicProtein
  • 840
  • 1
  • 11
  • 28
0
votes
1 answer

Calculating Efferent Coupling in Java

I need to calculate the Efferent Coupling (Coupling Between Objects) of a Java program from the source file. I'm already extracting the Abstract Syntax Tree with jdt in Eclipse, but I'm not sure if it's possible to directly extract class…
Tristan
  • 1,349
  • 2
  • 16
  • 25
0
votes
1 answer

Afferent and efferent coupling for JavaScript in Sonar?

Is there a way to calculate afferent and efferent coupling for JavaScript in SonarQube? I'm trying the project sample described in "Get Started in Two Minutes" section and I've already install the JavaScript plugin.
Giacomo
  • 111
  • 6
0
votes
2 answers

c++ design: reducing coupling in a deep class hierarchy

Please consider this class hierarchy: #include struct Base { Base(int arg1, int arg2, int arg3, int arg4) { std::cout << "Base::Base:" << arg1 << "," << arg2 << "," << arg3 << "," << arg4 << std::endl; } void…
Simon Elliott
  • 2,087
  • 4
  • 30
  • 39
0
votes
1 answer

How can I avoid semantic coupling to create a reusable display engine?

DisplayEngine has a list of DisplayableObjects. Each DisplayableObject derived class uses a different set of data. So I have created a base class for data so that I can pass BaseData into the update for each DisplayableObject without having to…
Ganamede
  • 13
  • 2
0
votes
1 answer

Applying Law of Demeter in a way that does not improve design

Suppose, we have the following Boy class that tries to arrange a date with a Girl by analyzing her schedule (example in Java): public class Boy { public boolean tryArrangeDate(Girl girl, Date time) { boolean success = true; for…
Volodymyr Tsukur
  • 275
  • 1
  • 3
  • 10
0
votes
2 answers

CakePHP: Highly codependent models, callback issues and data workflow

I have a very cohesive relation between Order and Item models. Order hasMany Item Item belongsTo Order Item hasMany ChildItem ChildItem is alias for Item (it's a recursive model) The Order Model has a special Order::prepare() function. It fires a…
Vanja D.
  • 834
  • 13
  • 20
0
votes
3 answers

When a class "has a" relationship with other class objects

Let's say we have a Car, Wheel, and Brakes classes. A Car "has" four wheels so when an instance of Car is created, I want 4 instances of Wheels created at the same time. Likewise if I were creating a Motorcycle, I would want two instances of…
0
votes
2 answers

Share important instances without coupling

Let's say you're writing a "bigger" application and you want to log certain errors in your classes. Now almost every class needs access to a Logger. One simple solution would be the following (PHP, but that doesn't matter): class SomeClass { …
MarcDefiant
  • 6,649
  • 6
  • 29
  • 49
0
votes
1 answer

exceptions and coupling

I have this main-class that receives a queuemessage and then uses a few other classes to do some work. All these other classes use some lower classes themselves, and eventually data is written to a database or send to wcf services. Based on the…
user369117
  • 775
  • 1
  • 8
  • 19
0
votes
0 answers

split component and communication

I have a main class (Main.java) who extends JFrame. Main class containt a left panel who contain two panels. The first one (Component) contain many TabelPanel and the second is named Property. I have a center panel (design) and a bottom panel who…
redfox26
  • 2,020
  • 4
  • 25
  • 33
0
votes
1 answer

Should/does loose coupling also be applied between methods of the same class?

Assume class A with methods M1 and M2 has low coupling with other classes a) Should we also make sure that each individual method in class A is not tightly coupled with any other method in the same class? Thus, should we make sure that changing code…
user1483278
  • 929
  • 1
  • 9
  • 17
0
votes
1 answer

How does High Cohesion help us reduce Coupling?

Assume methods M1 and M2 have strongly related responsibilities First example: If • M1 and M2 are defined within class A ( thus class A is highly cohesive ) • class B uses A.M1 and class C uses A.M2 then • A is coupled with both B and C classes •…
user1483278
  • 929
  • 1
  • 9
  • 17
0
votes
1 answer

How to submit an R job on linux ?

I am a engineer newbie to R and have got a script which I have to run on linux, I searched alot but was not able to find a simple command to run the script on linux. I have to couple my engineering software with R so I need to run it also on…
hamad khan
  • 369
  • 1
  • 5
  • 14
1 2 3
13
14