IDEA: Updated ViewServices Contracts..

11 views
Skip to first unread message

Rishi Oberoi

unread,
Jan 14, 2011, 5:35:48 AM1/14/11
to nro...@googlegroups.com
One of the things I want to do is update the built-in ViewServices; there are couple of issues with the ViewServices contract, for one, some of them are inadvertently tied to implementation specific details  (e.g. the IShowMessageViewService), two, some of contracts suggest it is for a single setup or is not reusable (e.g. IShowErrorViewService)  - however that is not correct, so I want flatten some of the contracts to suggest re-usability i.e. callable with just a method call. Lastly, where possible I want to make the contracts cancel'able by providing back an IDisposable token. 

Below are some of the my proposed updates:
    public interface IOpenFileViewService
    {
        OpenFileResponse OpenFile(string filter, int filterIndex, bool multiselect);     }
    public interface ISaveFileViewService
    {         SaveFileResponse SaveFile(string filter, int filterIndex, string defaultExt);     }
    public interface IShowErrorViewService
    {
        void ShowError(string title, string message);

        void ShowError(string title, string message, Exception error);     }
    public interface IShowIndicatorViewService
    {
        IDisposable ShowIndicator();

        IDisposable ShowIndicator(TimeSpan timeout);
    }
    public interface IShowMessageViewService
    {
        IDisposable ShowMessage(string message, bool isCancellable);

        IDisposable ShowMessage(string title, string message, bool isCancellable);

        IDisposable ShowMessage(string message, bool isCancellable, Action<bool?> confirmationCallback);

        IDisposable ShowMessage(string title, string message, bool isCancellable, Action<bool?> confirmationCallback);     }
    public interface IShowStatusViewService
    {
        IDisposable ShowStatus(string status);

        IDisposable ShowStatus(string status, TimeSpan timeout);

        IDisposable ShowStatus(string status, Action acknowledgementCallback);

        IDisposable ShowStatus(string status, TimeSpan timeout, Action acknowledgementCallback);
    }

Well, if anyone has any opinion or suggestion on any of the above please let me know, as I'm about to bake these in.
Rishi

John Thiriet

unread,
Jan 14, 2011, 5:42:31 AM1/14/11
to nro...@googlegroups.com
Hi,

From what I read I absolutely agree. I've had some issues with unit testing and the coupling of some of these view services (Show Message View Service). I really like the new definition you suggest.

Cheers

2011/1/14 Rishi Oberoi <orkt...@gmail.com>



--
------------------------
John Thiriet

Reply all
Reply to author
Forward
0 new messages