B
B
bullock2018-02-16 21:59:00
Programming
bullock, 2018-02-16 21:59:00

The question of the organization of architecture. Performance or maintainability?

In the process of writing an application, it always breaks me into writing beautifully and maintainably or effectively and ugly. The question is how much slower does the application become if abstractions are used everywhere to comply with SIP?
In one of my applications, I have a Save controller in which I read the stream from the HTTP body of the message and pass this stream to my other application (like micro services). There is not much code, but perhaps it should be placed in a separate object? But then, every time the client accesses this controller, I will have to create this object and these are resources.
What do you do in such cases?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
L
longclaps, 2018-02-16
@bullock

every time the client accesses this controller, I will have to create this object

Connection pool - have you heard of this? If it's really necessary, they do it.

G
Griboks, 2018-02-16
@Griboks

You are too obsessed with the principles of programming. This is good only in "heavy" large projects, but it greatly spoils small applications. Any constructions should be introduced as needed, and not because it is so beautiful and correct.

D
DoctorPro, 2018-02-17
@DoctorPro

Calculate whether there are any advantages from such an architecture, SIP, as well as other development principles, this, of course, is a guideline, but this does not mean that under the conditional helloworld you need to create a bunch of abstractions in accordance with the principles. There are other principles, for example, KISS (Keep it simple). If you do not see obvious advantages, then you may not need a lot of abstractions

Y
Yerlan Ibraev, 2018-02-19
@mad_nazgul

Information to think about

M
Maxim Fedorov, 2018-02-19
@qonand

Do not get hung up on principles and blindly follow them. The choice between performance and maintainability is always based on the characteristics of the project. It is worth considering how important maintainability is in general in a particular project and how much performance-improving solutions can worsen it. If the project is small or is developed as some kind of temporary solution, then it is unlikely that performance code will greatly degrade maintainability. If the project is large and changes will be actively made to it in the future, you should prefer performance maintainability

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question