Questions tagged [loose-coupling]
The loose-coupling tag has no usage guidance.
208
questions
0
votes
0
answers
17
views
React/Typescript - Trying to create a container for loosely coupled services, but then the services are not being built/compiled
I am trying to create a container that I can use to register and get services, but when I try to access the service it is not found. It's like the compiler is ignoring my file and not including it ...
0
votes
0
answers
43
views
As we know we cannot instantiate, but i have gone through a code and found that object is created and how?
I have this interface
public interface GamingConsole {
void up();
void down();
void left();
void right();
}
This is the class where we are instantiating
public class GameRunner {
...
0
votes
0
answers
39
views
How to follow PoLP with a cloud run application and multiple services without tight coupling
Imagine the following situation:
We have a gcp cloud run backend application running. Authentication is required and the ingress is set to "Internal + Load Balancing".
Other services are ...
0
votes
2
answers
431
views
Using Akka.net with Asp.net on a Modular Monolith architecture
Iwould like to implement a rest service using Akka and Asp.net.
Following the example here
I create my AkkaService containing the FooActor ref and a controller who transform the http request to a ...
1
vote
2
answers
437
views
Spring boot @Autowired vs Dynamic Polymorphism in case of loose coupling?
Hi I guess this question is quite basic but please help out!!!
Let say I have one interface Write and 2 implementing classes Pen and Pencil
public interface Write {
public void writeSomething(...
0
votes
2
answers
142
views
Reduce coupling in a SOAP client
Currently we're usign jax-ws to create and consume SOAP web services, generating java classes through the wsimport goal.
We then, create a Service class to call this web service. The code in the ...
0
votes
1
answer
361
views
Loose coupling in Dart
I was trying to implement loose coupling in one of my Flutter projects. It was not able to find the method.
Have replicated the same in a simple Dart code, how can I fix this, and is there some way to ...
0
votes
2
answers
600
views
tight coupling and loose coupling examples with Java code
I am aware of the distinction between tight coupling and loose coupling, according to this articles: https://www.upgrad.com/blog/loose-coupling-vs-tight-coupling-in-java/
What I do not understand is ...
1
vote
2
answers
534
views
How does Spring Framework choose between two components?
I'm new to Spring and Dependancy Injection, so I'll do my best, but this question may not be perfectly formed.
In short, imagine a 'sandwich' program that has a 'cheese' component. swiss cheese and ...
0
votes
1
answer
102
views
why is my PubSub pattern not working as intended
Please I am a bit confused why my code is not working.
I am trying to practice PubSub design pattern using the code below. The class instance displayGreet is subscribed to the messaged event published ...
0
votes
1
answer
367
views
How to load data from different property files based on query parameters from the rest API?
I have a endpoint which exports the data from the database and I have another endpoint which imports the data . I want to export the data from the one database and import to other but that should be ...
0
votes
1
answer
156
views
How loose coupling is achieved in Annotation based approach
How loose coupling is achieved in annotation based approaches? Because if I want to make any changes in the bean, I have to make the changes in corresponding java class. So how can I say it is loosely ...
0
votes
2
answers
117
views
Reducing coupling from switch statement
private void initialiseVehicle(String vehicleName) {
if (vehicleName == null) {
} else {
switch (vehicleName) {
case "Boat":
vehicle = new Boat("...
0
votes
1
answer
113
views
Does passing an object as a parameter result in the same level of coupling as having it stored in a field?
class ConcreteObserver implements Observer {
String text;
public void actualize(Subject subject) {
this.text = subject.getState();
}
}
In other words, does the code above make my ...
0
votes
1
answer
531
views
Loose coupling in c#
Is dependency injection is the only way to achieve loose coupling in c#
?? I have been going through injection (DI), to solve the tight coupling, I found DI as one solution for that ! Buy I'm looking ...
2
votes
1
answer
438
views
Best practices for runtime-only dependencies in OSGi
In line with the Open-Closed Principle, I typically design my Java packages and libraries in such a way that there is a generic "interface" or "API" package/library and one or more ...
0
votes
0
answers
25
views
AutoMapper and loosly coupled tables
Imagine this scenario.
I store documents references and paths in a table.
Multiple different entities and store documents in this table
This table has no foreign keys except for DocumentType
...
0
votes
0
answers
65
views
How can I extract only the name of the defined function from a function like macro in C?
Let's say I want to have 2 modules, which are loosely coupled.
The first module is depending on the interface of the other module.
I would like to decouple them by introducing defines for the ...
1
vote
1
answer
1k
views
How can achieve loose coupling 'Service Oriented Architecture' (SOA)? Explain using a suitable solution
An IT architecture composed of software that has been exposed as “Services” – i.e. invoked on-demand using a standard communication protocol. So, loose coupling on how to use SOA, give a good example.
1
vote
1
answer
278
views
Is my use of Enums as a couple value a bad practice?
For context, using C# inside the Unity3D Editor.
I have more and more often started using enums to loosely couple things to settings.
For example i am setting up an item, and i want to give it a ...
-1
votes
1
answer
77
views
How to do loose coupling of command programmatically?
I am making a mobile app using Xamarin. And using Prism to achieve MVVM with loose binding between Views and ViewModels.
In one View, I am creating buttons programmatically from the code behind, like ...
1
vote
1
answer
221
views
Improving my code with loose coupling or high coupling if any?
I want to improve my code using GRASP by creating an even lower coupling to my code. In my example I'm not sure whether I'm making lower coupling at all, and if I'm making loose coupling instead of ...
6
votes
1
answer
2k
views
Micro-services architecture loose coupling complications
I'm fairly new to the whole micro-services bandwagon. I have been doing some research into the architecture and principles behind a good micro-services environment.
One of the main things that ...
0
votes
1
answer
877
views
Cyclic api calls in microservices
Assume there are two services,
Product Service
Coupon service
Coupon is tagged against the product. And when the coupon is changed for any product there is an API call from product service to the ...
0
votes
1
answer
182
views
how 2 different applications implemented on different language communicate through JMS?
Can 2 programs in different language like one in C and other in Java can communicate through JMS? If yes how and if not how messaging is implemented in 2 different platform applications?
2
votes
2
answers
2k
views
too many rest api calls in Microservices
Say there are two services,
service A and service B.
Service A needs data from service B to process a request. So as to avoid tight coupling we make a rest API call to the service B instead of ...
0
votes
1
answer
3k
views
Real life example of high cohesion and loose coupling for presentation [closed]
I need to do a presentation about high cohesion and loose coupling. To explain this to my audience, I need to come up with a real life example (not code-based) of those 2 terms and I kinda have ...
2
votes
1
answer
278
views
Is this considered low coupling & high cohesion? Any chance to improve?
I'm trying to get hold of the SOLID principles by Robert C. Martin. Currently I'm looking into low coupling & high cohesion. I've created some code which represents my current understanding of ...
2
votes
3
answers
3k
views
Django model method for saving values
I'm wondering is it a good practice to have methods in Django model just for setting and saving values? For example I have a model:
class Team(models.Model):
name = models.CharField(max_length=50)...
7
votes
3
answers
2k
views
optimization of high cohesion and loose coupling
I was questioned in a technical interview about cohesion and coupling of a project. I extensively explained their definitions, although I did not answer the second part of the question properly, as he ...
0
votes
1
answer
160
views
Build Very Simple Minimalist Java Plugin Container
I'm working on an app where I'm in need of building a very small and minimal plugin container.
Below are the things I'm trying to achieve.
Application is divided into smaller plugins packaged as ...
2
votes
0
answers
994
views
How to Handle Memory Leak Issues Due to INotifyPropertyChanged Events?
I have been working on a project with UWP and it has a lot of INotifyPropertyChanged events attached to a lot of properties. Now what happens is that when I navigate from page to page it causes a huge ...
2
votes
1
answer
5k
views
Loose coupling vs tight coupling of services
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 ...
1
vote
1
answer
118
views
Should Api Managers deal with backend authentication in place of the subscriber?
We currently use WSO2 Api Manager to reach some backends.
The thing is, the consumer must :
First authenticate to the API Manager (Oauth)
Then authenticate to the Backend api (Whatever security in ...
-5
votes
3
answers
1k
views
Tightly or loose coupled with static methods [closed]
public Interface IFoo()
{
void DoSomething();
}
public class Foo
{
private IFoo _ifoo;
public Foo(IFoo foo)
{
_ifoo = foo;
}
public void Bar()
{
// ...
1
vote
0
answers
301
views
Should I go tightly coupled, with singleton, or loosely coupled, without a singleton? Azure Services, Xamarin Forms
I am making a Xamarin Forms Cross platform app.
I have been trying to figure out how to go about getting my app to integrate with the Azure Backend the best way.
I have ran into a problem. It has been ...
0
votes
0
answers
54
views
accessing key values from external file inside xsl
I have an xsl file and there are few variables inside a javascript code( tag) which have hard-coded values.As I need to change the hard-coded values sometimes, I want these values in another file as ...
5
votes
2
answers
2k
views
How do you decouple Web Components?
I'm trying to work frameworkless, with pure javascript Web Components. I want my Web Components to be able to work stand-alone and be used on different sites, and yet I also want two components to be ...
2
votes
3
answers
290
views
Does Law of Demeter also account for standard classes?
Assuming the following code:
requiredIssue.get().isDone()
where requiredIssue is an Optional and it has been verified that requiredIssue.isPresent(). Does this code break the Law of Demeter? ...
2
votes
1
answer
841
views
How do i generate the Kendo UI controls dynamically based upon the model properties passed from controller to cshtml
Requirement: I am suppose to develop an search widget which should generate the kendo controls based upon the model properties passed to the cshtml.
For example: If the model contains following ...
0
votes
2
answers
490
views
How to avoid the type of coupling in the given code?
I am stuck at some random problem based on Coupling.
A class Candidate with various methods for getting information about the candidate. One of such methods is getScore() score obtained by the ...
0
votes
1
answer
2k
views
Async procedure call using service broker in Sql Server
I have a backup procedure (production) running daily on a schedule and the backups generated are used periodically to refresh the lower environments. I'm building an automated solution to download ....
0
votes
1
answer
170
views
When should we prefer hard coupling over loose coupling?
With all the hype about loose coupling (with reason) and all the information ive read its easy to get all obsessed, to the point of becoming religious about it. Ive been wondering, when is hard ...
0
votes
2
answers
93
views
When should I create factory or VM in angular
This is how my angular app looks like.
(function () {
"use strict";
angular
.module("app")
.controller("custCtrl", custCtrl);
custCtrl.$inject = ['dataService','custFactory'];
/* @ngInject ...
0
votes
0
answers
499
views
can loose coupling be achieved in spring just by using annotations - avoiding xml
I have gone through a example from https://www.mkyong.com/spring/spring-loosely-coupled-example/ .
The example below uses beans to achieve loose coupling.
How can we achieve the same loose coupling ...
1
vote
3
answers
853
views
Keeping classes loosely coupled and sharing data
I've been working in python on a project where I have a GUI which I split up a bunch of the work between classes. I don't know a lot of the best practices for passing data around between classes, and ...
-3
votes
1
answer
70
views
How to implement main method fallowing code based on loose Coupling [closed]
Fallowing code explain the loose coupling concept. I want to implement the main method to added items (with price and quantity) and calculate the total price with sales tax. How I implement the main ...
1
vote
1
answer
794
views
Microservices & Kafka: To couple or not to couple
I'm having a problem wrapping my mind around a probably normal setup of Microservices and Kafka we are currently setting up.
We are having one Topic in Kafka and multiple consumers reading from ...
0
votes
0
answers
50
views
How to implement a Java light weight dependency analizer that generates a simple text raw listing?
The output should show something simple like this (or anything else that could be still simple):
A depends on B, C and D
B depends on E and F
F depends on A (warning: coupling problem!)
The ...
1
vote
1
answer
31
views
How to refactor these classes to interact each other?
My requirement is to use the name of the shape and draw that shape with the dimensions like in the method Draw('rectangle', 'l:10,w:20');.
There should be validation of the dimensions against the ...