Questions tagged [bridge]

A design pattern that decouples an abstraction from its implementation so that the two can vary independently. One of the Gang of Four's structural design patterns.

The Bridge pattern is a design pattern used in software engineering which is meant to "decouple an abstraction from its implementation so that the two can vary independently". Bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes.

This is one of the Gang of Four's structural , first published in Gamma et al.'s book "Design Patterns: Elements of Reusable Object-Oriented Software".

More information is available on Wikipedia.

Bridge Design Pattern on SourceMaking

Bridge Design Pattern on GeeksForGeeks

Bridge Design Pattern example video

455 questions
5
votes
1 answer

Docker on CentOS with bridge to LAN network

I have a server VLAN of 10.101.10.0/24 and my Docker host is 10.101.10.31. How do I configure a bridge network on my Docker host (VM) so that all the containers can connect directly to my LAN network without having to redirect ports around on the…
Eroji
  • 339
  • 1
  • 7
  • 20
5
votes
3 answers

Javascript bridge / upcall to JavaFX (via JSObject.setMember() method) breaks when distributing

The Problem I spent several hours trying to determine why my distributed code fails and yet my source code when debugging with the IDE (NetBeans) works without issue. I have found a solution and am posting to help others that might have similar…
DatuPuti
  • 629
  • 7
  • 17
5
votes
2 answers

How to bridge throwable Swift initialiser with Objective-C code?

Let's say we have a Swift class with an initializer which can throw an error. This class must be used in Objective-C codebase (NSObject subclass): import Foundation enum EvenError : ErrorType { case NonEvenNumber } class FooEven : NSObject { …
Lukasz
  • 19,816
  • 17
  • 83
  • 139
5
votes
3 answers

Docker container cannot access internet

I'm on my second week of working through this problem and nothing on the internet has helped fix my issue. The problem is that without specifying --net=host, I cannot access the internet from my docker containers. /home/dnadave> docker run -it…
DNADave
  • 73
  • 7
5
votes
3 answers

Bridge Pattern - Composition or Aggregation?

I'm reading some books about Design Patterns and while some describe the relation between the abstraction and the implementation as a composition, some describe it as an aggregation. Now I wonder: is this dependant on the implementation? On the…
helpermethod
  • 59,493
  • 71
  • 188
  • 276
5
votes
2 answers

Correct undestanding of Bridge Pattern

Am I correctly undestand Bridge Pattern: BEFORE: public class Main2 { @SuppressWarnings("unused") public static void main(String[] args) { Car car11 = new BadNativeCar(); Car car12 = new…
drifter
  • 683
  • 1
  • 11
  • 24
4
votes
2 answers

"certificate verify failed" when bridging AWS IoT with local Mosquitto MQTT

I have a mosquitto MQTT on a local raspberry pi working like a charm. I created a MQTT broker on AWS IoT that works as well. On my raspberry pi I can connect, publish and subscribe on the AWS broker "manually", using the commands mosquitto_pub and…
btech
  • 49
  • 6
4
votes
4 answers

Difference between Bridge and Decorator pattern

i am learning software design pattern and want to know the difference between bridge and decorator pattern interface Iconcept { void action(); } class concept : Iconcept { public void action() { …
Lijin Durairaj
  • 4,910
  • 15
  • 52
  • 85
4
votes
3 answers

How to change the IP address of a docker after creating it?

I have a docker linked to a bridge with IP address 192.168.150.1/24. Once I create the docker instance from a docker image it gets an IP address, 192.168.150.2, but according to my requirement, this IP address, 192.168.150.2, must be reserved since…
Lakshmikanth B
  • 95
  • 1
  • 1
  • 9
4
votes
2 answers

Setting up virtual bridge: Cannot find device "br0"

Setting up a virtual bridge with Ubuntu with following config in /etc/network/interfaces auto brOffline iface brOffline inet static address 192.168.5.10 netmask 255.255.255.0 bridge_ports eth11 bridge_stp off bridge_fd 0.0 pre-up ifdown…
Cutton Eye
  • 3,207
  • 3
  • 20
  • 39
4
votes
2 answers

Why is JDBC a typical application of Bridge design pattern?

I found from lots of resources that JDBC is a typical example of Bridge design pattern. But they usually didn't tell the details, so I would like to know the details. According to my understanding: Driver interface is the bridge between the…
Rui
  • 3,454
  • 6
  • 37
  • 70
4
votes
4 answers

Extending both sides of a Visitor/Bridge pattern

Say I have a hierarchy of classes, let's use the classic Shape examples: abstract class Shape Circle : Shape Square : Shape I have a second hierarchy of renderer classes that handle the rendering of shapes in different ways: abstract class…
Dale
4
votes
1 answer

How do you properly emit and receive an event from a bridged iOS module to JavaScript using React Native?

I have a React Native app and want to dispatch an event from Obj-C to test how the app event/emitting system works. I have read all the docs, thumbed through the react native repo for examples to follow and still don't know what is wrong with my…
Aaron
  • 7,055
  • 2
  • 38
  • 53
4
votes
1 answer

how to connect Docker containers without a bridge?

I'm having some experiments to do with Docker container technology. I need for a specific reason to connect two veth container interfaces together without using a bridge, Docker creates a bridge by default, so I do not want to use it. I'm confused…
user2567806
  • 460
  • 3
  • 7
  • 17
4
votes
1 answer

Get Unresolved Identifier for MMWormhole in Watch InterfaceController.swift

My Apple Watch project is in Swift. I have used CocoaPods to install MMWormhole, and I created the bridging header as described in these links: http://bencoding.com/2015/04/15/adding-a-swift-bridge-header-manually/ How to call Objective-C code…
murvinlai
  • 48,919
  • 52
  • 129
  • 177
1 2
3
30 31