Questions tagged [architecture]

The high-level design and description of a software system. Architectural design distills away details of implementations, algorithms, and data representation to concentrate on the interaction of "black box" components.

Further Reading

3447 questions
424
votes
33 answers

How do I create my own programming language and a compiler for it

I am thorough with programming and have come across languages including BASIC, FORTRAN, COBOL, LISP, LOGO, Java, C++, C, MATLAB, Mathematica, Python, Ruby, Perl, JavaScript, Assembly and so on. I can't understand how people create programming…
Dave
  • 261
  • 3
  • 4
  • 4
291
votes
17 answers

Is premature optimization really the root of all evil?

A colleague of mine today committed a class called ThreadLocalFormat, which basically moved instances of Java Format classes into a thread local, since they are not thread safe and "relatively expensive" to create. I wrote a quick test and…
Craig Day
  • 563
  • 3
  • 5
  • 5
213
votes
16 answers

When using the Single Responsibility Principle, what constitutes a "responsibility?"

It seems pretty clear that "Single Responsibility Principle" does not mean "only does one thing." That's what methods are for. public Interface CustomerCRUD { public void Create(Customer customer); public Customer Read(int CustomerID); …
Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
209
votes
11 answers

What is the advantage of little endian format?

Intel processors (and maybe some others) use the little endian format for storage. I always wonder why someone would want to store the bytes in reverse order. Does this format have any advantages over the big endian format?
Cracker
  • 3,153
  • 5
  • 19
  • 20
167
votes
17 answers

Is it better to return NULL or empty values from functions/methods where the return value is not present?

I am looking for a recommendation here. I am struggling with whether it is better to return NULL or an empty value from a method when the return value is not present or cannot be determined. Take the following two methods as an examples: string…
162
votes
8 answers

Criticism and disadvantages of dependency injection

Dependency injection (DI) is a well known and fashionable pattern. Most of engineers know its advantages, like: Making isolation in unit testing possible/easy Explicitly defining dependencies of a class Facilitating good design (single…
Arkadiusz Kałkus
  • 1,770
  • 2
  • 12
  • 15
152
votes
9 answers

Is there any "real" reason multiple inheritance is hated?

I've always liked the idea of having multiple inheritance supported in a language. Most often though it's intentionally forgone, and the supposed "replacement" is interfaces. Interfaces simply do not cover all the same ground multiple inheritance…
131
votes
7 answers

Clean Architecture: Use case containing the presenter or returning data?

The Clean Architecture suggests to let a use case interactor call the actual implementation of the presenter (which is injected, following the DIP) to handle the response/display. However, I see people implementing this architecture, returning the…
127
votes
10 answers

Don't Use "Static" in C#?

I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use static. You can't write automated tests with static classes and methods. static is to be avoided." I…
Infin8Loop
  • 1,459
  • 2
  • 11
  • 16
124
votes
7 answers

What is the most effective way to add functionality to unfamiliar, structurally unsound code?

This is probably something everyone has to face during the development sooner or later. You have an existing code written by someone else, and you have to extend it to work under new requirements. Sometimes it's simple, but sometimes the modules…
Coder
  • 6,958
  • 5
  • 37
  • 49
115
votes
4 answers

Which way are downstream and upstream services?

For a system that consist of multiple services calling each other (e.g. Front End -> Backend -> Storage), I often heard people using terminology such as "downstream" or "upstream" services. I'm not clear which direction these mean. Data flows in…
user69715
  • 1,259
  • 2
  • 9
  • 4
108
votes
5 answers

Aren't the guidelines of async/await usage in C# contradicting the concepts of good architecture and abstraction layering?

This question concerns the C# language, but I expect it to cover other languages such as Java or TypeScript. Microsoft recommends best practices on using asynchronous calls in .NET. Among these recommendations, let's pick two: change the signature…
corentinaltepe
  • 971
  • 2
  • 6
  • 6
104
votes
9 answers

Why should I use dependency injection?

I am having a hard time looking for resources on why I should use dependency injection. Most of the resources that I see explains that it just passes an instance of an object to another instance of an object, but why? Is this just for cleaner…
Daniel
  • 1,045
  • 2
  • 7
  • 5
100
votes
7 answers

What is the most accepted transaction strategy for microservices

One of the major issues that I have seen occur in a system with microservices is the way transactions work when they span over different services. Within our own architecture, we have been using distributed transactions to resolve this, but they…
Kristof
  • 2,201
  • 3
  • 14
  • 13
97
votes
8 answers

RESTFul: state changing actions

I am planning to build a RESTfull API but there are some architectural questions that are creating some problems in my head. Adding backend business logic to clients is an option that I would like to avoid since updating multiple client platforms is…
Miro Svrtan
  • 1,129
  • 1
  • 8
  • 6
1
2 3
99 100