简体   繁体   English

Silverlight:是否将本地WCF服务用于业务逻辑(中间WCF服务)? (Ria服务与常规WCF服务一起使用?)

[英]Silverlight: Use of a local WCF service for business logic (intermediate WCF Service)? (Ria services in conjunction with a normal WCF Service?)

I have my silverlight calling my WCF service and its working great. 我的银光呼唤我的WCF服务及其运作良好。 This is a WCF (not ria) service that basically returns enitites or collection of entities. 这是一种WCF(不是ria)服务,基本上返回实体的实体或集合。

I really don't have control over it to add additional items just for silverlight for example. 我真的没有控制权来添加其他项目,例如,仅用于Silverlight。

So i was thinking but maybe its bad performance or desgin.. 所以我在想,但也许它的表现不佳或设计。

But to have a local WCF Service hosted with the Asp.net website that hosts silverlight.. ANd i can use this wcf service for business logic that doesn't need to return entities. 但是要在承载Silverlight的Asp.net网站上托管本地WCF服务。并且我可以将此wcf服务用于不需要返回实体的业务逻辑。 For example so silverlight can call to the server and then the server can do something with PURE .net. 例如,因此silverlight可以调用服务器,然后服务器可以使用PURE .net进行某些操作。

Of course i still will need my silverlight to talk to my External WCF service that returns entities etc.. 当然,我仍然需要Silverlight与我的返回实体等的外部WCF服务进行对话。

What would be the best way to implement this, if at all.. 如果有的话,什么是实现此目标的最佳方法。

Silverlight calls local WCF service and "IF REQUIRED" local wcf service calls external WCF Service (which returns entities etc) and everything is returned back down the chain. Silverlight调用本地WCF服务,而“如果需要”本地wcf服务则调用外部WCF服务(返回实体等),然后一切都沿着链条返回。

or Silverlight calls to local WCF service or to external WCF service depending on what is required. 或Silverlight对本地WCF服务或外部WCF服务的调用,具体取决于所需的内容。

There is a 3rd option but i am thinking aloud and maybe it wouldn't fit... But to have RIA services so silverlight could call this .... but again I CANNOT get rid of or have control over my other wcf service... So silverlight would need to call both OR ria services could call the wcf service ... But this is where i have a doubt... because RIA services normally return IQUERYABLE for example... My wcf service returns ILIST for example so if ria services called to my wcf service it would receive back an ILIST .. hence the [QUERY] attribute in ria services require me to return IQUERYABLE but it isn't possible because i am already in an ILIST. 有第三个选项,但是我正在大声思考,也许不合适。。。但是拥有RIA服务,因此Silverlight可以称呼此..但是我仍然无法摆脱或控制我的其他wcf服务。 ..因此,silverlight将需要同时调用两个OR ria服务,而可以调用wcf服务……但这是我所怀疑的地方……因为RIA服务通常返回IQUERYABLE,例如……我的wcf服务返回ILIST例如,所以如果ria服务调用了我的wcf服务,它将收到一个ILIST ..因此,ria服务中的[QUERY]属性要求我返回IQUERYABLE,但由于我已经在ILIST中而无法执行。

I would really appreciate some feedback to weather i am completely missing the point or infact its a good idea. 我非常感谢您提供一些有关天气的反馈意见,我完全不了解这一点或认为这是一个好主意。

The fact remains that silverlight sometimes needs to do standard stuff on the server but has nothing to do with dataaccess or entities... i have no control over the external wcf service so i can't just insert a new method specifically for silverlight when its needed.. 事实仍然是,Silverlight有时需要在服务器上执行标准的工作,但与数据访问或实体无关...我无法控制外部wcf服务,因此我不能仅在Silverlight插入特定的新方法时使用它需要..

Anybody use a similar system, PROS / CONS?? 有人使用类似的系统吗?PROS / CONS?

Thanks in advance 提前致谢

I think your application should use only Ria Services and then Ria service should connect to the external service. 我认为您的应用程序应仅使用Ria服务,然后Ria服务应连接到外部服务。 Then all logic is on the server and your SL app has simple model of using services. 然后,所有逻辑都在服务器上,并且您的SL应用程序具有使用服务的简单模型。 You can think about is as all business logic is on the server. 您可以考虑一下,因为所有业务逻辑都在服务器上。

What about returning IQueryable you always can "convert" list to IQueryable using linq, but I think you can return list from RIA Service - it shoudn't be a problem. 关于返回IQueryable的问题,您始终可以使用linq将列表“转换”为IQueryable,但是我认为您可以从RIA服务返回列表-这不成问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM