loose-coupling

Mediator/EventAggregator differences

戏子无情 提交于 2020-08-03 03:48:10
问题 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 between those patterns. Can anyone describe them for me? 回答1: The two are mostly used for the same reason; reducing coupling between classes. I have even seen implementations of both, doing exactly the same thing, namely passing information as a

How to Implement Loose Coupling with a SOA Architecture

隐身守侯 提交于 2020-01-12 02:20:12
问题 I've been doing a lot of research lately about SOA and ESB's etc. I'm working on redesigning some legacy systems at work now and would like to build it with more of a SOA architecture than it currently has. We use these services in about 5 of our websites and one of the biggest problems we have right now with our legacy system is that almost all the time when we make bug fixes or updates we need to re-deploy our 5 websites which can be a quite time consuming process. My goal is to make the

Micro-services architecture loose coupling complications

无人久伴 提交于 2019-12-28 07:03:10
问题 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 defines a micro-service is supposed to be the loosely coupled nature of each service. Micro Service A should never call Micro Service B directly, or you're effectively creating a monolithic system that looses the scalability offered by the architecture pattern. Question / example If I develop a micro

Passing a parameter through constructor

一曲冷凌霜 提交于 2019-12-25 04:19:16
问题 First I will present a quick outline of a somewhat tightly coupled classes (though not the worst possible case): class setUpGUI { ... JTextField output = new JTextField(); ... CountTimer ct; ... public void setOtputText(String text) { output.setText(text); public startTimer() { ct = new CountTimer(); } ... } class CountTimer implements ActionListener { private String text = ""; private gui = new SetUpGUI(); ... @Override public void actionPerformed(ActionEvent e) { ... gui.setOtputText(text);

Lua: can I use “require” as a form of dependency injection?

此生再无相见时 提交于 2019-12-22 20:27:12
问题 I'm designing a hospital integration system which consumes data from various hospitals (our customers), and then applies specific business rules to said data based on reading configurations from a database. If I were using Java, my first instinct would be to build a series of interfaces representing the various business rules, and then inject concrete instances (using Spring/guice) to compose a fully configured object. This would allow me to achieve a clean separation between configuration

Loose Coupling and OO Practices for Beginners

只谈情不闲聊 提交于 2019-12-21 04:31:24
问题 Keeping classes loosely coupled is an important aspect of writing code that is easy to understand, modify, and debug--I get that. As a newbie, though, just about anytime I get beyond the most simple examples I struggle. I understand, more or less, how I can encapsulate strings, integers, and simple data types in classes of their own. When I start dealing with information like rich text formatting, however, things get really complicated--unless I just use the various methods already present in

How do you decouple Web Components?

浪尽此生 提交于 2019-12-20 02:47:44
问题 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 able to communicate. So they should be able to communicate without being tightly coupled. Back when I did Angular, this was easy. I can pass objects to a component through a HTML attribute, and the component receives it as an object rather than a string. But in pure javascript, attributes are

Construct testable business layer logic

依然范特西╮ 提交于 2019-12-17 17:16:18
问题 I am building an applications in .net/c#/Entity Framework that uses a layered architecture. The applications interface to the outside world is a WCF service Layer. Underneath this layer I have the BL, Shared Library and the DAL. Now, in order to make the business logic in my application testable, I am trying to introduce separation of concerns, loose coupling and high cohesion in order to be able to inject dependencies while testing. I need some pointers as to if my approach described below