samedi 24 octobre 2015

Model View Controller- Parser in View

I am implementing CLI tool using MVC pattern. I want to pass Event objects from View to Controller in order to inform Controller about the user action. Is it a proper way to implement an argument parser in View module? For example:

User command: 'python cli-tool --some_action --verbose'

In Event class I would like to have 'verbose' bool flag and action_type Enum. For having this done I would like to implement a parser that will create Event object with its variables. Controller would read the Event object.

On the other hand, isn't that sharing some business logic with the View, which is not accepted in MVC? What do you think?

Aucun commentaire:

Enregistrer un commentaire