Showing posts with label .NET Framework. Show all posts
Showing posts with label .NET Framework. Show all posts

Tuesday, June 3, 2008

Yet Another reason why Properties should be used instead of Fields


Today, I did a little experiments on Properties VS Fields. It is better to use properties especially when that property is to interact with the other DLLs or external Assemblies.


Scenario: library.library.Name is a field in my library which I refer in my winapp. I executed it worked fine. I wanted to validate Name field for special characters so I decided to change “Name” (At present a Field in library) to a property so that I could validate it in the set property.


As the member name and the return type (string) did not change I did not recompile my winapp. But I got the following exception “Field not found” as it’s a property now.



Conclusion: When you need a member to interact with the external assemblies or DLLs or EXEs make it a property instead of field. This enables you to add validators later within your class.




Sunday, August 26, 2007

List of Feature .NET Framework

Features in .net 2.0

1. Webparts
2. Profile services
3. membership services & membership controls
4. Role management services
5. Master Pages
6. Sitemaps
7. Dataset designer (Enables to easily create strongly typed dataset and Data access layer)
8. Caching
SQL Cache dependency
SQL Cache dependency(with broker service)
Partial page caching
9. Annonymous delegates
10. Partial class
11. Generics
12. Personalization
13. Data controls (sqldatasource, xmldatasource, object datasource, etc)
14. New Provider Model
15. ASP.Net configuration tool
16. Reporting services
17. Type Forwarding

Note: There are even more features in .net 2.0

Features in .Net 3.0

1. Windows Communication Foundation ( The Unified Framework For Rapidly Building
Service-Oriented Applications )
2. Windows Presentation Foundation
3. Windows Cardspace
4. Windows Workflow Foundation (Tools and engine for building workflow-enabled apps )


Features in .Net 3.5

1. Ajax enabled controls
2. LINQ, DLINQ, BLINQ, PLINQ, XLINQ
3. LINQ to SQL, Linq to XML, Linq to datasets
4. Extension methods
5. Lambda expressions
6. Query expressions
7. Expression trees
8. Anonymous types
9. collection and object initializers
10. Typed local variables and arrays
11. LinqSqlDataSource control added
12. Enables debugging of javascript and intellisense for javascript