开发者

Do attributes make your objects heavy

开发者 https://www.devze.com 2023-03-13 19:26 出处:网络
Hi I have a class t开发者_C百科hat I will be adding lots of attributes onto its properties. It could be about 3 per property. these attributes will be used by a T4 template to determine how to wrap th

Hi I have a class t开发者_C百科hat I will be adding lots of attributes onto its properties. It could be about 3 per property. these attributes will be used by a T4 template to determine how to wrap the object in html. eg I could wrap my textbox in a span and that span in a div and give the div a css class.

will my class be heavy?


No, attributes are metadata. They are baked into the assembly at compile time. If there is nothing reading them at runtime you shouldn't worry about performance or your object being heavy.


They do make your application heavier in maintenance costs. If you do branch per feature, you will have way more conflicts to resolve than if you went with conventions instead.

0

精彩评论

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