XmlSerializer vs DataContractSerializer: Serialization in Wcf

这篇文讲得不错,可惜居然要翻墙。

摘录:

The XmlSerializer has been in .Net since version 1.0 and has served us well for everything from Remoting, Web Services, serializing to a file, etc. However in .Net 3.0 the DataContractSerializer came along.? And all of a sudden a lot of guidance suggests that we should use it over the old tried and true XmlSerializer. Wcf even uses this as the default mechanism for serialization.? The question is, “Is it really better?”.? The verdict is yes, and no.? Like most things it depends on your implementation and what you need.? For Wcf, you should prefer to use the DataContractSerializer.? If you need full control over how the xml looks though, you should go back to the XmlSerializer.

Lets look at the both of these in detail and leave it up to you to decide which is best for your implementation.? Here are a few of the advantages and disadvantages of each of them:

。。。。。。。。

关于贷记卡和借记卡,以及借的主要含义

借和贷的概念很容易搞混,特别是在中文里,“借”字有借入的意思,也有借出的意思。甲对乙说“借你500块钱”,他的意思是“来,给你500块”呢还是“给我500块用着先”呢?好吧,严格来说应该是前者,后者应该说“借你的500块钱”。但有时人们会不小心说错,借紧接着人的时候,是借出的意思,紧跟着物品的时候,是借入的意思,但是如果物品后又有“给某人”,那么借又变成借出的意思了。

中文真是神奇啊。

这就和晒东西类似,晒任何东西都是把它拿到太阳下,东西被晒,但是晒太阳就不符合这种规则。一个词的意思在不同的语句中有不同(如晒)甚至相反(如借),但是词语总是有诞生的一刻的。哪个意思才是它诞生的第一含义,其他的又是在何种情景下衍生和发展出来的。如果有一双眼在观察在每一个人类发展的角落和时刻,他就可以给出答案。update: 考虑到文字总是在语言之后产生的,第一个用这个声音来表示这个意思的“人”也是一个可以给出答案的人。问题是我们如何获取答案呢?

以下段落来自维基,Assets = Liabilities + Equity (A = L + E),也可以说是E=A-L。

For instance, from a bank customer’s perspective, when a person deposits cash into his bank chequing account, this financial transaction has two aspects: the customer’s cash-in-hand (the customer’s asset) decreases and the customer’s chequing account balance (the customer’s asset) with the bank increases. The decrease in the cash-in-hand asset is the customer’s credit while the increase in the asset balance in the bank chequing account is the customer’s debit.

The bank views that transaction using the same rules, but from its different perspective. In that example, the bank’s vault cash (asset) increases which is a debit, and the corresponding increase in the customer’s chequing account balance (bank’s liability) is a credit. This is why a customer’s bank statement issued by the bank shows the bank’s liability to the customer, with increases (bank deposits) as credits, and decreases (bank withdrawals and cheques) as debits.

In summary(无论对任何一方): an increase (+) to an asset account is a debit. An increase (+) to a liability account is a credit. Conversely, a decrease (-) to an asset account is a credit. A decrease (-) to a liability account is a debit.

也就是debit是资产增加责任减少的意思,做动词来说是好事,credit反过来,是坏事。

我觉得作为名词,可以理解成debit的数字是资产,credit的数字是责任。

这说明XX卡的定义是以个人角度的名词,debit卡的余额是用户的资产,credit卡的积累的金额用户的责任。