Exploring Software Architecture

Learn about more common system design patterns; event-driven, P2P, service-oriented, client-server architectures, and design considerations.

Event-driven architecture (EDA)

Event-driven architecture (EDA) is where the application’s data model is updated through user-triggered and system events, which often signal to change something about the data model state. As we saw in the model-view-presenter section, the presenter utilizes events that are triggered by actions taken by the user on the user interface (for example, clicking a button). As such, EDA is often associated with OOA and can also be used in conjunction with DDD.

P2P architecture

We've already covered P2P in program management to some degree, but it is worth expanding upon here. There are two types of P2P networks:

  • Structured

  • Unstructured

Structured network

A structured network has a strict topology that is adhered to as hosts leave and join the network. Every host has a list of nearby hosts or neighbors so that any one host can easily access another host. This type of network results in a lot of discovery traffic being broadcasted but allows us to find a peer or file quickly.

Unstructured network

An unstructured network has no imposed structure and is resilient to changes in hosts dropping and adding to the network. However, finding a specific host or file is not guaranteed. This is a problem particularly when using P2P for file sharing, because rare files will be just as rare to successfully find. For a messaging app, the biggest hurdle to this type of structure would be finding our contacts on the network if relying strictly on searching. A way to share direct-connect information between two parties would alleviate some of this pain.

Service-oriented architecture

Service-oriented architecture (SOA) is arguably the most-used architecture in the tech industry today. SOA is the basis for cloud-based architectures and offers a logical separation of concerns in larger organizations.
The figure below takes the Mercury desktop application and reimagines it in an SOA setting. Let’s take a look at how this changes the design and behavior of the system.

Get hands-on with 1200+ tech skills courses.