Hi,
I would prefer this third idea :
void start(){
Request next_action = request_provider.get_next();
next_action.execute();
}
Interface Request {
void execute();
}
class Add implements Request {
void execute() {
// blabla
}
}
Why this one ? Because if I want to add a new type of request, I don't
have to modify anything except of adding a new type of request :)
Hope it helps.
Cheers
> --
> The only way to go fast is to go well.
> ---
> You received this message because you are subscribed to the Google Groups
> "Clean Code Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
clean-code-discu...@googlegroups.com.
> To post to this group, send email to
clean-code...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/clean-code-discussion.
--
Frédéric Bouquet
Twitter/Github : bouquetf
http://www.espacedefouille.org/