Question

I'm new to software architecture, and application specification. I need write the specification of a project, where I need to have a CLI and a GUI (the GUI needs to be optional).

I've made a class diagram of the interfaces part and I need some feedback from people better than me.

Class Diagram

Explanations :

I am using Qt. The idea is to have a graphical interface with 3 tabs in order to change the parameters.

GUI is my main window, it contains the 3 pages who derived from QWidget (in order to put them into my QTabWidget).

CLI is my command line interface, it's in reality a QtScript class, who run in an infinite loop and wait for the user to enter a command.

Once the user click "save configuration" or enter "saveConf()" in the CLI, the parameters of GUI or CLI are transmited into ActualConfiguration.

The AllParameters class is used to add every parameters in my 3 class easily.

ActualConfiguration will write the parameters value into a file.

EDIT: After some answer, I'm thinking of using AllParameters as an instance used by CLI GUI and ActualParameters (See the Class Diagram who have been edited too)

Questions :

Is my architecture is going to work ?

Is it good if in order to comunicate with my application core, I write the configuration into a file, and read it with my application core ?

Have you any idea/comments/advice to give me ?

Thanks.

Was it helpful?

Solution

In really class part it has errors, and the lower part is not a class diagram at all.

  • Do your pages have different classes?
    • If not, use only one Page and leave the association from Gui as you have it.
    • If yes, make a common parent type for them and set association from Gui to the parent.
  • You have no multiplicities there
  • All parameters is not a parent class really for all you have drawn there. It seems, you mixed Dependency( - - - - - > slashed line) and Generalization connectors.
  • Two associations have no arrows. Are they really two-directional?

"CLI is my command line interface, it's in reality a QtScript class, who run in an infinite loop and wait for the user to enter a command.

Once the user click "save configuration" or enter "saveConf()" in the CLI, the parameters of GUI or CLI are transmited into ActualConfiguration."

  • Such things are not for showing in class diagram, but in a sequence diagram. Or, at least, activity or component one.

OTHER TIPS

This diagram is not necessarily bad or good because it can implemented quite differently.

I need to have a CLI and a GUI (the GUI needs to be optional)
...
Once the user ..., the parameters of GUI or CLI are transmited into ActualConfiguration.

From what I see the user interface (GUI or CLI) should expose the same API to the other components. Either via signal and slots, composition or inheritance of a common class (my least desired choice when using Qt).

At the same time you need another component which provide the API for the processing. So UI API provide user request to Processing API, which executes and return feedback to UI API.

Your architecture need to be very simple to be scalable. When you start designing software you are tempted to make a custom architecture which is very complex. What if the number of user input change from 3 to 30? What if you have more parameters in the future? Is it easy to keep track of the data flow in my app?

All of this chit-chat to say you should probably follow a three-tier or two tier architecture (which is similar to the mvc pattern)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top