Why you need partial methods in c#? Can events be used to achieve the same goal?

后端 未结 4 1723
南笙
南笙 2021-01-04 08:48

I was reading the book \"Apress Pro LINQ: Language Integrated Query in C#\" and I came across partial methods, but I really don\'t understand what is the need for them.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 09:27

    They are not "needed", but desired for large scale applications. Extensive use of events leads to the Smart UI anti-pattern where the business logic is tightly coupled with the user interface, whereas partial functions allow you to better separate your concerns.

    Here is a link to the MSDN C# programming guide on partial methods as well. http://msdn.microsoft.com/en-us/library/wa80x488.aspx

提交回复
热议问题