1

I already know of various software design patterns, and I am familiar with MVC. However, now that I am learning about other patterns (repository, client-server, pipe, and layered), I got a bit confused about the implementation of these patterns.

Can there be a combination of patterns in a single software system? If so, how would this work?

Doc Brown
  • 206,877
  • 2
  • 2
    Have you used a website? Then you very likely have used a software system that uses some form of MV* (e.g. MVC, MVP, MVVM, HMVC) and that is also, simply by the very nature of how the web works, client-server. – Jörg W Mittag Jul 21 '20 at 15:20
  • 2
    Are they over-teaching "Patterns" in CompSci courses now? I feel the site has been flooded with questions about Pattern usage where the person posting the question clearly has very little experience actually using/understanding them. – GHP Jul 21 '20 at 21:01
  • "skyscraper" and "mud hut" are two distinct architectural styles. Is it possible to build a mud hut on top of my skyscraper? Sure, why not. Do I need to and/or is it a good idea? Well that's a completely different question. – Flater Jul 22 '20 at 12:58
  • @Graham: I mean, you're not wrong, but that's a biased observation. If they fully understood a pattern, they wouldn't be asking a question about the pattern itself. All you can really infer is that more people seem to want to learn about patterns. – Flater Jul 22 '20 at 13:02

1 Answers1

5

Let's focus on the architectural patterns you mentioned (repository, client-server, pipe, layered).

A client-server system consists of programs or components which run on the client, and others which run on the server. Each of these components can have a layer structure internally. One of these layer may be a repository layer (for example, for decoupling other parts of the program from the database access code).

Both the client components as well as the server components may contain a "business logic layer". And for certain kinds of business logic, it makes sense for this layer to be structured internally by pipes and filters. For example, a 3D rendering engine on the client side can be structured by using a rendering pipeline. A system which does heavily asynchronous batch processing on the server side (for example, for filling / updating a data ware house every night) can have a batch processing pipeline.

So in short, different architectural patterns appear at different levels of abstraction. And in any larger real-world system one will usually find several of those patterns.

Doc Brown
  • 206,877