Lenkelheit / Coursework

This repository contains Instagram-like application
Apache License 2.0
1 stars 0 forks source link

Create MultipleCommand Class #185

Closed iamprovidence closed 5 years ago

iamprovidence commented 5 years ago

This command should have an opportunity to execute many commands(queue behaviour). And also it should check if next command in line can be executed. for example if we have two command in line (checkValue, Save) and checkValue return false other commands should be interrupted. I think we can do this with our special exception or we could add Property to CommandBase. How to implement this should be discussed before developing

Lenkelheit commented 5 years ago

And about our special exception, what is it?

iamprovidence commented 5 years ago

I thouhgt something like NotExecutedCommandException. But second option seems better for me. We can add some enum to CommandBase, like CommandState { ok, wrong } and so on. and if command after executing has bad state, other command should not be executed

iamprovidence commented 5 years ago

I think, CommandState can be like this CommandState { Default,// state has not been changed Executed, // command has been successfully executed Interrupted // command has been interrupted }