G
G
GineTik2021-05-06 11:07:07
C++ / C#
GineTik, 2021-05-06 11:07:07

How to improve the logic for building complex structures?

Hello!

I have a course book where I need to implement a menu using commands. (such as in cmd for example)
But I can't build the structure of the application, its hierarchy!

Where can I pull it up, can find examples or something!
I tried to google, but I didn’t find anything normal.

I would like to say that I can make commands using ifs, and users using one class with a role field, but somehow I don’t really want to (plus each user has his own capabilities, etc.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-05-06
@GineTik

In OOP, this is solved using the Composite pattern
https://refactoring.guru/en/design-patterns/composite
Without OOP, you can solve it with a recursive call.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question