开发者

WCF Best Practice/Cleanest Method implementation in Silverlight

开发者 https://www.devze.com 2023-02-10 15:51 出处:网络
http://www.dnrtv.com/default.aspx?showNum=122 After Watching the Above video \"Extreme WCF\", I like the clean approach taken towards the layout of code.

http://www.dnrtv.com/default.aspx?showNum=122

After Watching the Above video "Extreme WCF", I like the clean approach taken towards the layout of code.

However this does not directly apply to Silverlight.

I was wondering if either anyone knew how to tie the proxy at the end of the video into Silverlight, or if anyone knew of a similar method tidying WCF up.

Either that or a discussion on WCF techniques would be very helpful.

Thanks

  public class Proxy : ClientBase<ITaskAuditService> , ITaskAuditService
{
    #region ITaskAuditService Members

    public IEnumerable<TaskAuditType> GetList( string measure, string userName, string taskReason )
    {
        return Channel.GetList(measure, u开发者_运维知识库serName, taskReason);
    }

    public IEnumerable<string> GetUsers()
    {
        return Channel.GetUsers();
    }

    public IEnumerable<string> GetTaskReasons()
    {
        return Channel.GetTaskReasons();
    }

    public IEnumerable<string> GetMeaures()
    {
        return Channel.GetMeaures();
    }

    #endregion
}

as requested the code is here i'm just missing the method of getting this into a silverlight project (and making it asyncrhonus)


For the best pratice, you may want to take a look at this book

Programming WCF Services from Juval Löwy

It's the best book I found on the subject and it have a Chapter on "WCF Coding Standard"

I can't copy paste the entire chapter but you should be able the find it somewhere on the internet.

By the way, it's a good reference if you think using WCF for a while...

0

精彩评论

暂无评论...
验证码 换一张
取 消