Is it a good practice or good idea to have a stock of actions?
Hi my friends, today I come with the following questions.
I am trying to create a basic structure type RCP but extensible by means of plugins for my applications and thus not having to copy and paste and modify some other things before starting a new project.
The doubts are the following:
1-. Is it a good practice or good idea to have a stock of actions for the application? (so there are actions that are needed in different contexts, but the exact same thing must be performed)
2-. On the other hand and in the same order of ideas, it would be a good practice or good idea to work with a factory of actions (factory pattern)?
Re: Is it a good practice or good idea to have a stock of actions?
Quote:
1-. Is it a good practice or good idea to have a stock of actions for the application? (so there are actions that are needed in different contexts, but the exact same thing must be performed)
2-. On the other hand and in the same order of ideas, it would be a good practice or good idea to work with a factory of actions (factory pattern)?
I personally could not understand quite what you mean (especially with your first point).
Never the less, using specific patterns is not on its own a good or bad practice - such things are case specific - in one case it might be better to use a factory in another maybe not.
The use case is important, and you didn't say much about it, so its hard to say.
Re: Is it a good practice or good idea to have a stock of actions?
Hello high_flyer
Thank you for responding and sorry for my tardiness.
What I am looking for is to have a list of actions to be reused for menus and toolbars, as well as to subclassify the QActions to add customized data or characteristics so that the contexts receive mixed types of QActions, since some complements require actions "global" of the application.
On the other hand, I have resolved to apply the QAction list in a convenient way to do what was proposed in my initial post