.NET 4.5 Developer preview is out with Visual Studio 2011. I was already thinking to try out what's new in .NET 4.5 myself and share what exactly been changed.
Lets start by the new Regex Api introduced with the framework. The improvement that has been made is minor yet handy at certain cases. The Regex class of .NET 4.5 supports Timeout. Lets take a look how to work with it.
Handy Tricks and Tips to do your .NET code Fast, Efficient and Simple. Some common questions that comes into mind. Please check if you could find them listed or not.
Showing posts with label Patterns. Show all posts
Showing posts with label Patterns. Show all posts
Friday, October 21, 2011
Monday, September 26, 2011
Internals of .NET Objects and Use of SOS
Well, now getting deeper into the facts, lets talk about how objects are created in .NET and how type system is laid out in memory for this post in my Internals Series. As this is going to be very deep dive post, I would recommend to read this only if you want to kill your time to know the internal details of .NET runtime and also you have considerable working experience with the CLR types and type system.
Recently I have been talking with somebody regarding the actual difference between the C++ type system and managed C# type system. I fact the CLR Type system is different from the former as any object (not a value type) is in memory contains a baggage of information when laid out in memory. This makes CLR objects considerable different from traditional C++ programs.
Classification of Types
In .NET there are mainly two kind of Types.
Recently I have been talking with somebody regarding the actual difference between the C++ type system and managed C# type system. I fact the CLR Type system is different from the former as any object (not a value type) is in memory contains a baggage of information when laid out in memory. This makes CLR objects considerable different from traditional C++ programs.
Classification of Types
In .NET there are mainly two kind of Types.
- Value Types (derived from System.ValueType)
- Reference Type (derived directly from System.Object)
Even though ValueTypes are internally inherited from System.Object in its core, but CLR treats them very differently. Indeed from your own perception the Value Types are actually allocated in stacks (occationally) while reference types are allocated in Heaps. This is to reduce the additional contension of GC heaps for Heap allocation, GC cycles, occasional call to OS for additional memory needs etc. The object that is allocated in managed Heap is called Managed Object and the pointer that is allocated in stack to refer to the actual object in heap is called Object Reference (which is sometimes called as Managed Pointer).
Thursday, September 1, 2011
31 Tips for the month on Threading, WPF, MEF, ASP.NET
Daily .NET Tips is aiming to sharing useful coding tips and tricks for .NET Developers. This site completely design for sharing Tips and Tricks, useful Code Snippet which anyone use in daily development work and targeted anything related with .NET. This month we have wide range of tips including Threading, MEF, WPF and MVC. In this post I am quickly listing down all the tips which are published over the month August 2011. And the most important point to mention, among those 31 tips that has been posted on DailyDotnettips this month 22 is coming from me.
- Working with AggregateCatalog in MEF
- Working with DirectoryCatalog in MEF
- Working with AssemblyCatalog in MEF
- Working with TypeCatalog in MEF
- How to use DebuggerTypeProxy while debugging your sensitive Type
- ASP.NET Calendar Control as Outlook Calendar
- Initialize assemblies using PreApplicationStartMethod for ASP.NET 4.0 Application
- Async Lambda Expression
- Playing with ASP.NET List Controls using jQuery
- How to allow user to input html in ASP.NET MVC?
- Using Mutex to avoid deadlocks
- Writing inline Code in WPF
- What is SynchronizationContext all about
- ThreadLocal storage in .NET
- Barrier in .NET 4.0
- Use of Interlocked in Race Condition
- Call ASP.NET Page Methods using your own AJAX
- Use of SpinLock for ThreadLocking
- Using ReaderWriterLock over Monitor for Thread Locking
- What is the use of IsBackground property of Thread?
- Enable Address Level Debugging in Visual Studio
- Get List of all Control Types in WPF
- How to apply simple faded transparent effects on WPF controls ?
- Use Visual Studio Server Explorer to Add New or Existing SQL Server CE Database
- Co-Ordinated Thread Shutdown with and without using CancellationTokenSource
- Generate thousand of request
- Writing a Stretchable ContentControl in WPF
- How to Retrieve WPF Visual Tree Programmatically ?
- What is Visual Tree and Logical Tree in WPF?
- Dealing with HWND in WPF
- Hosting a WPF control inside a Windows Form
To get regular updates visit http://dailydotnettips.com and follow @dailydotnettips at Twitter.
I hope you would like the posts. Stay tune for more.
Labels:
.NET 4.0,
architecture,
ASP.NET 4.0,
C#,
MEF,
Patterns,
Reflection,
Threading,
tips,
WPF,
XAML
Saturday, August 27, 2011
Steps to write a plugin based application with MEF
I have already written a blog on Managed Extensibility Framework few days ago, and you must wonder why I am writing again. Well actually today I have been creating an application that could be easily plugged into a host application. In this blog lets show you in steps how you could easily create your own plugin based application and later change itself easily using MEF.
Labels:
.NET,
.NET 4.0,
beyondrelational,
C#,
MEF,
Patterns,
windowsclient.net
Sunday, July 31, 2011
Internals of Dependency Property in WPF
WPF introduces new property system to us. Every WPF objects that is inherited from DependencyObject inherently supports Dependency property containers within it. That means you can define your own dependency property in your code which can take part in some of the interesting features of WPF like Binding, Styles, Triggers, Animation, Property Inheritence etc. Today I will concentrate on how Dependency Property system is actually built and what are the benefits we get instead of using CLR property system.
Note : If you are really new in WPF and don't know about Dependency Property, it would be nice to read my post on Dependency Property or you can also try WPF Tutorial series to start on.
So lets start on using the most basic code of creating your own Dependency Property.
Note : If you are really new in WPF and don't know about Dependency Property, it would be nice to read my post on Dependency Property or you can also try WPF Tutorial series to start on.
So lets start on using the most basic code of creating your own Dependency Property.
Labels:
.NET,
.NET 3.5,
.NET 4.0,
architecture,
beyondrelational,
C#,
CodeProject,
internals,
Patterns,
WPF,
XAML
Saturday, July 16, 2011
ValueTypes and ReferenceTypes : Under the Hood
In .NET, Value Type and Reference Types are forms an element of confusion between both developers and the students. Many of us take this as granted that Value Types are allocated in Thread Stack ( a 1 MB local stack created per Thread) and on each method calls the local value types are allocated in the Stack such that after the call ends, the object is deallocated. On the contrary, the reference types we know are those which are always allocated in heap (which is not always true, I will discuss later) and even though they are used as locals, and will be deallocated only after an interval by a separate Thread that is running with any .NET process (called finalizer thread) which occationally starts finding the memory blocks on Heap storage and compact and store only the reachable objects called Garbage Collector. Well, in this post, I am not going to cover the details of Garbage Collection, but rather I will focus more on Value Types and Reference Types that I know personally to clear any doubt regarding them in terms of IL constructs. So after reading the post, you will know some of the basics of IL too.
Labels:
.NET,
.NET 3.5,
.NET 4.0,
.NET Memory Management,
C#,
CodeProject,
internals,
Memory Allocation,
Patterns
Sunday, June 5, 2011
Working With Prism 4.0 (Hello World Sample with MVVM)
Modularity is one of the primary concern when working with a big projects. Most of us think of how we can implement our application that could be reusable across more than one applications. Patterns and Practices Team puts forward the notion of modularity with the help of Unity and Prism which most importantly focus on WPF and Silverlight applications. Being a WPF developer, it would be nice to take this apart and explain you a bit of how you can implement your application using Prism.
Before you begin, I must tell you, this is the most basic article that guides you step by step how you can write your first Prism based application and what are the advantages of building such kind of application. I will take this further in my next posts to make more concrete samples. So if you know the basics of how you can work with Prism, I would recommend you to read my next posts.
Also I assume you have some knowledge of Unity, WPF and MVVM to get you through with Prism.
Where do I find Prism?
Prism is a framework introduced by Patterns and Practices Team which is available from here. After you install your bits, you will get a folder named Prism on your local drive. After you are done, lets start coding.
Before you begin, I must tell you, this is the most basic article that guides you step by step how you can write your first Prism based application and what are the advantages of building such kind of application. I will take this further in my next posts to make more concrete samples. So if you know the basics of how you can work with Prism, I would recommend you to read my next posts.
Also I assume you have some knowledge of Unity, WPF and MVVM to get you through with Prism.
Where do I find Prism?
Prism is a framework introduced by Patterns and Practices Team which is available from here. After you install your bits, you will get a folder named Prism on your local drive. After you are done, lets start coding.
Labels:
.NET,
beyondrelational,
C#,
CodeProject,
design pattern,
Patterns,
Prism,
Unity,
WPF,
XAML
Subscribe to:
Posts (Atom)
Author's new book
Abhishek authored one of the best selling book of .NET. It covers ASP.NET, WPF, Windows 8, Threading, Memory Management, Internals, Visual Studio, HTML5, JQuery and many more...
Grab it now !!!
Grab it now !!!