English 中文(简体)
是否应当对IoC集装箱进行业务逻辑单一吨位的序列化处理?
原标题:Shouldn t an IoC container be handling serialization of business logic singletons?

以下陈述和一个问题基于我自己的经历,如果有些不正确,你可以自由指出。 事实上,我真心赞赏它。

在几乎所有的申请结构中,开发商都使用IoC集装箱溶解型号,即:InSingletonScope()(从Ninject获得的术语,但我确信,大多数情况下都会有意思)。

An example of a class instance, that you only need one of, could be an implementation of ICloudStorageProvider for example.

If an ICloudStorageProvider implementation instance is comprising a login data to the cloud account in a form of a nested LoginData class, or just the plain Login and Password fields, so far I ve been calling a method like LocalStorageProvider.SaveLoginData(...) whenever I needed to persist it. A different class, that knew how to do it, saved the data for my class instance.

如果存在一种机制,允许将此类“ing子”物体的整批编号到当地数据库中,从而使生命更加容易。 那么,如果重新启用,或再次需要潜水器,那么,它就只能将它与上述示意图数据结合起来。

由于IoC集装箱是目前发射的物体的责任,因此似乎与这种责任完全吻合。

是否有这样的机制,这种机制既是IoC又是序列的,?

最佳回答

我不知道你为什么要做这样的事情,但是,我这样认为最好仿照旧的生活方式。 基本上,它是一种延伸至beyond的生活方式。 单吨和横跨多个集装箱。

然而,在大多数情况下,单一州服务往往是无国籍的,在这种情况下,按顺序排列的服务就没有什么意义。

无论是否可能为Ninject I写一个习俗寿命,但习惯寿命在 rel=“nofollow”>,Castle ,,StructureMap Unity/

一个相关的问题是:how? 在NET中,最容易的方式是使用既有的双轨序列器,但这就要求图表中的所有物体都与[可再生]属性或可实施IStroizable相加。 还有其他一些选择,但大多数要求采用某种选择适用机制,因此会严重限制哪些服务可以序列化。

问题回答

暂无回答




相关问题
SQL Server - How many users do I *really* need?

I m setting up an application, and I m looking into purchasing a license for SQL Server. My question is pretty simple (though may have a complicated answer...) How many users accounts do I really ...

Object Graph / Persistence Question

I m currently working with an online application that requires multiple screens/steps in order to complete. The application domain is modeled using an object graph. Persistence to and from a database ...

Why does stack get truncated in Exception.StackTrace?

Why does the high part of the stack (in Exception.StackTrace) gets truncated? Let s see a simple example: public void ExternalMethod() { InternalMethod(); } public void InternalMethod() { try ...

ASP.NET MVC and Service Oriented Architecture

I would like to know how do i incorporate a feature like wcf within and MVC application. My current idea of the architecture is as follows: EntityFramework -> ASP.NET MVC (Views) ...

热门标签