DirectoryTechnologyBlog Details for ".NET with me - Vikas Goyal"

.NET with me - Vikas Goyal

.NET with me - Vikas Goyal
Microsoft.NET Technology Blog, All about .NET technology , wcf, wf, enterprise library
Articles: 1, 2, 3, 4

Articles

* Singleton Creational Pattern
2007-09-28 06:40:00
One of the most popular creational pattern. It is used to restrict the number of instances of a type to one and so all clients use the same instance. Consider the following class diagram : Client creates two variables of type Singleton, s1 and s2.  The client code looks like following : public class Client { Singleton s1,s2; public void Run() { // s1 = new Singleton(); // new cannot be called. s1 = Singleton.GetInstance(); s1.ID = 999; s2 = Singleton.GetInstance(); Console.WriteLine("ID = " + s2.ID); } }The output of s2.ID is '999' which shows that both s1 and s2 are referring to same instance of Singleton. Also note that default constructor has been protected.The code for actual 'Singleton' class looks like following : public class Singleton { public int ID; private static Singleton Instance; // Constructor is protected so that new cannot be cal...
More About: Tutorials , Architecture , Sharp , Pattern , Design Patterns
* Aspiring Software Architect Program (ASAP)
2007-09-26 07:50:00
Microsoft India is hosting series of webcasts for aspiring Software Architect s. Catch it LIVE ...  Aspiring Software Architect Program (ASAP)
More About: Architecture , Gram
* Completed 200 posts on this blog
2007-09-26 07:13:00
As I have completed 200 posts on this blog .. here are the few statistics for date range when the number of posts grew from 101 to 200 : Date Range : 19/March/2007 --- 23/Sep/2007 Visits : 38, 591 Page Views : 64,959 (Above data collected using Google Analytics) Thanks to all readers for the encouragement and kind words. Read analysis of first 100 posts.
More About: Blog , Posts
* Patterns : Prototype Creational Pattern
2007-09-24 09:19:00
Prototype Creational Pattern provides an interface which can be used by client to get access to already existing instance of a type which can be used as prototype by client to create new instance. Client can clone the existing object using deep or shallow copy and use it. It is used mainly when inherent cost of creating a new object is high. Consider the following class diagram : Above scenario goes like this : Client needs the updated list of managers. ListAdmin can provide the list but its not latest. Now, client instead of creating the list from scratch which can be very resource consuming, picks the list from ListAdmin, creates a shallow copy of it and updates it for further use. public class Client { public static void Run() { ManagersList managersList = ListAdmin.getManagersList(); Console.WriteLine("Printing managersList ...."); DisplayList(managersList); ManagersList list = (ManagersList)managersList.Clone();...
More About: Tutorials , Architecture , Sharp , Prototype
* Patterns : Factory Method Creational Pattern
2007-09-24 06:46:00
It provides an interface for creating an object but lets subclass decide which class to instantiates. So, it can also be called as virtual constructor. Consider the following class diagram : ShapeCreator class provides an factory method to create objects of BaseShape. Client always uses ShapeCreator and BaseShape type variables to work on instances of derives classes. The client looks like following : public class Client { ShapeCreator createsShape; public void Run() { BaseShape shape; createsShape = new CircleCreator(); shape = createsShape.CreateShape(); shape.WhoAmI(); } }The code of CircleCreator looks like following : public class CircleCreator : ShapeCreator { public override BaseShape CreateShape() { return new CircleShape(); } }The CircleCreator decides which class to instantiate in response to CreateShape() method.Download full source code from here : ...
More About: Tutorials , Architecture , Factory , Sharp , Pattern
* Patterns : Builder Creational Pattern
2007-09-21 12:00:00
Builder Creational Pattern separates the process of construction of a complex object from its actual representation. This means that the same process can create different representations of same object. Consider the following diagram : The main class here is ShapeCreator which is called Director and controls the process of construction of object.  // Director public class ShapeCreator { public void CreateSquare(SquareBuilder sb) { sb.Create(); sb.SetColor(); } }While Square is the actual object. RedSquareBuilder controls the actual representation of the object.Consider the following client code : public class Client { ShapeCreator d; public void Run() { d = new ShapeCreator(); //Director SquareBuilder sb = new RedSquareBuilder(); d.CreateSquare(sb); Square sq; sq = sb.GetSquare(); Console.WriteLine(sq.Color + " Color Squ...
More About: Tutorials , Architecture , Sharp , Patterns
* Jiglu : The Tagging Service
2007-09-21 08:04:00
I just found a tagging service which works cool  www.jiglu.com I have added the jiglu widget on left bottom of my blog. You need to do some work to remove some unwanted tags but still it scans the site well.
More About: Service , Tagging
* Assembly Version vs Assembly File Version
2007-09-21 07:16:00
.NET framework provides opportunity to set two different types of version numbers to each assembly. Assembly Version : This is the version number used by framework during build and at runtime to locate,link and load the assemblies. When you add reference to any assembly in your project, it is this version number which gets embedded. At runtime, CLR looks for assembly with this version number to load. But remember this version is used along with name, public key token and culture information only if the assemblies are strong-named signed. If assemblies are not strong-named signed, only file names are used for loading. Assembly File Version : This is the version number given to file as in file system. It is displayed by Windows Explorer. Its never used by .NET framework or runtime for referencing. So, how do you best make use of these file numbers available. This is one way of using it, if you guys know a better way .. let me know. Attributes in AssemblyInfo.cs // Version information ...
* Pattern : Abstract Factory Creational Pattern
2007-09-20 08:06:00
Provides a single interface for creating families of related or dependent objects without using the concrete type name. Consider the following class diagram : In above diagram, CreateShapes acts as an single interface for creating various families of products. The diagram shows only Red shapes but it can be extended to create more color shapes. The client code will look like this : public class Client { CreateShapes redShapes; public void Run() { redShapes = new CreateRedShapes(); redShapes.CreateCircle(); redShapes.CreateSquare(); } }Once the current instance has been assigned to variable of type CreateShapes, the remaining code remains same for every family.A practical use can be creating shapes for a particular theme.The complete source code can be downloaded from following location : Abstract Factory Creational Pattern Source Code
More About: Architecture , Sharp
* Design Patterns : Gang of Four
2007-09-19 11:02:00
Over next few days, I will be discussing the implementation of GOF design patterns in CSharp. I wont be discussing the benefits of Design Patterns here ... you can read about them here : Design Patterns . In one line : "They bring best practice for solving common design problems to software development which helps in ensuring success of design and increase in productivity." Here is a quick reference card of GOF patterns.  
More About: Gang
* WCF : Hosting in Partial or Medium Trust ASP.NET environment
2007-09-19 09:52:00
Read about ASP.NET Partial Trust environment. Currently WCF provides very little support for partial trusted environment. When hosting in medium trust environment - only basicHttpBinding is supported by default. If you want to use wsHttpBinding, security mode needs to be set as 'None' or 'Transport'. Default security mode for wsHttpBinding is 'Message'. Partially trusted callers are currently not allowed to call WCF services.
More About: Security , Environment , Hosting , Architecture
* ASP.NET : Partial Trust Environment
2007-09-19 07:26:00
ASP.NET runtime allows server administrators to configure runtime so that various asp.net applications can run in various levels of isolation and with various permissions. This is most relevant in shared hosting kind of scenarios. The various levels of trust available are : Full|High|Medium|Low|Minimal By 'Partial Trust ' means, server admin trust the applications hosted in web server only partially and so applications cannot perform lot of low level functions and do not have access to lot of system resources. For each level the various kinds of restrictions are applied on applicaitons. "Full" trust means that applications are assumed to be fully trusted and so have full permissions and access to all system resources. These permission are independent of what Operating System allows applications to do. The trust level at machine level can be configured using machine level web.config. <location allowOverride="true"><system.web> ;   <securityPolicy>&nbs...
More About: Security , Environment , Architecture , Envi
* 'Microsoft', 'Visual Studio Class Designer' and 'UML'
2007-08-30 06:35:00
If you are anyway related to software development you must have used/heard about UML. If you develop software on Microsoft platform, you should know about 'Visual Studio Class Designer '. UML has contributed a lot in developing a common language of communication across development team in software industry. It helps architects in communicating their design to developer community most effectively with only requirement that everyone should know UML. UML helps in giving standard based visualizations to the designs. Some of the visualizations it provides are : Class diagrams and relationships Use Case diagrams State diagrams Component diagrams Activity diagrams With Model driven development becoming more and more effective, Microsoft couldn't find the exact fit for UML in its MDD strategy and so developed something which is loosely based on UML but simpler and gives a better base to Domain Specific Languages and Modelling. You can read more about Microsoft's MDD. "Class Designe...
More About: Architecture
* How addicted I am ????
2007-08-28 07:04:00
84%How Addict ed to Blogging Are You?  I am posting after my longest break in blogging since I started this blog last year in November but believe me I am really getting addicted to it. Soon I will be changing the context of my blog slightly .. my post henceforth will be more 'Architecture' oriented and will reflect what 'Architects' do in their daily work life. I am planning to setup a wiki using MOSS 2007 for my team .. so will post my experiences and learning about wiki also.  Getting my new(another) desktop installed with windows 2003 for wiki site.
* Silverlight based Search Engine
2007-08-22 07:29:00
Check out the new Beta Silverlight based search engine from Microsoft. Its really cool. http://www.tafiti.com/
More About: Search , Search Engine , Engine , Base
* CSharp 3.0 Language Specification released
2007-08-21 11:34:00
CSharp Team @ Microsoft has released the specification document of CSharp 3.0. Its a comprehensive document and covers all earlier versions also. It includes LINQ too. Download CSharp 3.0 Spec doc What's new in CSharp 3.0
More About: Language , Released
* WCF : Understanding Security
2007-08-16 13:01:00
Previous Post <<-- WCF : Service Instances and Sessions By now I have completed most of the mandatory features of WCF which any WCF developer should know except 'Security ' which I will cover in this post. After this we will scope, design and develop our WCF real world application. If you have any ideas about real world application which we can use, pls let me know. Security requirements from any distributed technology can be classified into one of the following : Authentication (client & service) Confidentiality Integrity Replay Attacks Authorization (Access control) Evidence based Security ( Auditing) For 1, 2 & 3 WCF provides mainly three modes to ensure security apart from 'None'. Transport : Transport protocol is responsible for it e.g. Https Message : SOAP message security according to WS-Security standards Mixed Mode : Transport Security is used for Integrity, Confidentiality and Server Authentication. Message security for client authentica...
More About: Understanding
* WCF : Service Instances and Sessions
2007-08-16 08:32:00
Previous Post <<-- WCF : Understanding Data Contracts (Deep Dive) WCF allows developers to decide on how WCF should create instances of Service Object in response to client calls. It can be controlled by applying design time behavior attribute "System.ServiceModel.ServiceBehaviorAttri bute.InstanceContextMode" over service implementation. [ServiceBehavior(InstanceContextMode=Inst anceContextMode.PerSession)] public class MathService : IMathService {     ?} Following three instancing modes are available : PerCall : for each client call, a new service object is created. PerSession : If sessions are supported, a new object is created for each session and continues to service the client calls throughout the lifetime of session. Single : a single service object is created which handles all client requests from all clients throughout the lifetime of application. The session related behavior of WCF service can also be controlled by design time behavior attribute "Sy...
More About: Sessions
* WCF : Understanding Data Contracts (Deep Dive)
2007-08-16 07:11:00
Previous Post <<-- WCF Diagnostics : Message Logging Data contract is the understanding between client and service about the structure of the data which needs to be transferred between client and service in as native/simplest/standard form as possible. This removes the dependency of sharing types between client and service. e.g. in case of wsHttpBinding the data contract is in form of data types as defined by W3 Standard to make it fully interoperable. Only types which are marked by attribute DataContract or DataMember are serialized. Most of the native types are by default serialization enabled. Member accessibility levels (internal, private, protected, or public) do not affect the data contract. The DataMemberAttribute is ignored if it is applied to static members. Data Contract and Data Members can be given a name other than the type name by 'name' property.[DataMember(Name = "Address")]public string MyAddress;For client and service to be able to understand each othe...
More About: Deep , Contracts , Understanding , Dive
* WCF Tool : Service Trace Viewer Tool (SvcTraceViewer.exe)
2007-08-14 07:02:00
Previous Post <<-- WCF : Monitoring & Troubleshooting using Tracing Can be found  @ following location : <Installation_Drive>Program FilesMicrosoft SDKsWindowsv6.0Bin GUI based tool used for viewing trace and message log files generated by WCF framework. Although the log files generated are text files in XML format and can be viewed by other tools also but Service Trace Viewer Tool provides much more than that. It allows to view, merge and filter message in one or more files. The tool supports three types of log files : WCF Tracing File (.svcLog) Event Tracing File (.etl) - Converts it to WCF tracing format before opening. Crimson Tracing file - Converts it to WCF tracing format before opening. It supports the concept of projects where multiple log files can be added to a project, so that when you open a project all the files will be opened automatically. WCF trace file is an activity tracing format file which means the logs are grouped in activities an...
More About: Ice T
* WCF Diagnostics : Message Logging
2007-08-13 11:57:00
Previous Post <<-- WCF Tool : Service Trace Viewer Tool (SvcTraceViewer.exe) WCF provides sufficient, excellent and configurable out of box configurable message logging facility to monitor and troubleshoot incoming and outgoing messages. This is one of the major improvement over Remoting infrastructure. Mess age Logging is OFF by default. It provides various levels and options to configure extent of message logging. Service Level : At this level the message is logged when it is about to leave or enter the code. Secure messages are logged decrypted at this level. Transport Level : At this level messages are logged just before getting encoded or after getting decoded for transmission over wire. Even reliable messaging messages are logged. Malformed Level : All the messages which WCF fails to process due to improper format gets logged. Message Filters : Can be applied at Service and Transport. Only messages which match the filter are logged. Filters cannot be applied t...
More About: Diagnostics , Diagnostic , Gnostic
* WCF : Monitoring & Troubleshooting using Tracing
2007-08-09 15:41:00
Previous Post <<- WCF : Diagnostics Features Tracing by default is OFF. Provides traces for operation calls, code exceptions, warnings and other important processing events The main elements of Tracing functionality are following : Trace Sources : The places from where trace messages get originated. WCF defines a trace source for each assembly. Some of the trace sources defined by WCF are : System.ServiceModel : Logs all stages of WCF processing. System.ServiceModel.MessageLogging: Logs all messages that flow through the system. Trace Listeners : Traces generated by sources are consumed by listeners for further processing and logging. Listeners provided by System.Diagnostics can be used e.g. XMLWriterTraceListener. Trace Level : controlled by the switchValue setting of the trace source, some of the valid values are : Off, Critical, Error, Warning, Information, All, etc. Let's start from our last code tutorial where we hosted our basic MathService on IIS and crea...
More About: Troubleshooting , Monitoring , Troubleshoot , Shoot
* What's new in Visual Studio (Rosario) Aug CTP
2007-08-08 13:31:00
While Visual Studio 2008 is still in Beta, VSTS team @ Microsoft has already released the CTP for next version of VSTS after 2008 version. It has been code named as Visual Studio Team System Code Name "Rosario ". Some of the new features available in Aug, 2007 CTP are : It focuses mainly on complete Application LifeCycle Management (ALM) and Quality of code developed using VSTS. Development Scheduling, Tracking, Integration with Project Server and Dependency Management improves communication and collaboration with the Team. Allows to view Test Coverage of Software requirements. Better bug reporting functionality which includes video screen capture of events triggering bug. Its built on top of Visual Studio 2008 so comes with .NET 3.5 but should also be able to target other versions. Agile development methodologies seems to be working quite well at VSTS team with such frequent releases of Betas and CTPs :-)
More About: Sari
* WCF : Diagnostics Features
2007-08-08 11:22:00
Previous Post <- WCF : Hosting WCF service in IIS WCF provides an excellent out-of-box diagnostics features to monitor and troubleshoot client & services and communication between them. This is one of the major area of improvement over Remoting infrastructure which provided very little out-of-box. The best part is that most of it is fully configurable and you don't need to inject any diagnostics code in your functional code to achieve these features. Some of the features it provides are : Tracing : WCF provides an exhaustive trace messages infrastructure to monitor all success and failed activities happening in WCF scope. An excellent tool for troubleshooting the application. Message Logging : Lets you monitor incoming and outgoing messages. Event Tracing : All the breaking exceptions are logged into Event Viewer. Performance Counters : Enough performance counters available to monitor app health out of the box. In the next set of posts ...
More About: Features , Diagnostics , Feat , Diagnostic , Gnostic
* Java to DotNet (.NET) Migration - Options, Approaches and Tools
2007-08-08 10:34:00
As the integration between Windows OS, Servers & Tools is getting better and they are leveraging the powerful .NET platform, the number of projects for Java to .NET migration has increased considerably. The Productivity improvements introduced by MOSS & Composite applications and VSTS for both end users and development teams has triggered the motivation of moving to .NET further. In this post I will cover two important aspects of Java to .NET migration projects : How different Java/J2ee technology stack maps to .NET technology stack ? Various migration options and paths available to migrate with least impact on production sites and efforts. Java/J2SE/J2EE to .NET Technology Stack Mapping WEB LAYER Swing Windows Forms AWT Windows Forms JSPs ASPX pages JSTL ASP.NET Server controls Http Filters HttpModule Servlets HttpHandlers Web Container/Application Server ASP.NET / IIS Applets Windows Form User Controls APP LAYER EJBs Enterprise Services, Remoting, WCF RMI /...
More About: Options , To Do
* WCF : Hosting WCF service in IIS
2007-08-03 07:54:00
Previous Post <- WCF Tool : WCF IIS Registration Tool (Service ModelReg.exe) Pls start from the project created in following post : Developing a basic WCF client and service Add a class which will be used to store two numbers. [DataContract] public class Numbers { private int firstNumber; private int secondNumber; [DataMember] public int FirstNumber { set { firstNumber = value; } get { return firstNumber; } } [DataMember] public int SecondNumber { set { secondNumber = value; } get { return secondNumber; } } }Add another method to the contract which takes instance of Numbers and return the total of the two numbers stored in object. [OperationContract] int AddNum(Numbers numbers);Create a Virtual...
More About: Hosting
* WCF Tool : WCF IIS Registration Tool (ServiceModelReg.exe)
2007-08-03 07:50:00
Previous Post <<- WCF : Overview of Hosting in IIS This tool is used to manage the registration of ServiceModel with IIS. ServiceModel is required for hosting WCF services in IIS. Although if IIS is already present machine where .NET 3.0 is installed, the ServiceModel gets registered automatically but it case of issues this tool can be used for following : Regis tration Re-Registration UnRegister List all the components registered Verification of registered components. This tool can be found at following location : %windir%Microsoft.NETFrameworkv3.0Windows Communication Foundation If you have installed pre-release versions of WCF, you will have to do some manual changes in  machine.config. Pls chk MSDN for same. Next Post -> WCF : Hosting WCF service in IIS
More About: Tools , Tool , Stration
* WCF : Overview of Hosting in IIS
2007-08-03 07:37:00
Previous Post <<-- WCF Tool : ServiceModel Metadata Utility Tool (Svcutil.exe) WCF services hosted in IIS get all the benefits of IIS environment like scalability, recycling, etc. Can be hosted on IIS 5.1, 6.0 and 7.0 5.1 is recommended only for development while 6.0 and 7.0 can be used for production. 6.0 supports only http but as IIS 7.0 uses Windows Activation Service (WAS) for protocol activation and communication, protocols other than http are also supported. Before WCF services can be hosted in IIS, a WC HTTP activation component (ServiceModel) needs to be installed and registered in IIS. You can verify the installation of this component using tool called ServiceModel Registration Tool. WCF services can be hosted in same AppDomain as ASP.NET application in two modes : 1) Side-by-Side 2) ASP.NET Compatibility Mode In 'Side-by-Side' ASP.NET and WCF share the AppDomain state & so static variables etc. But ASP.NET HTTP Runtime process only ASP.NET requests...
More About: Hosting , Overview
* WCF Tool : ServiceModel Metadata Utility Tool (Svcutil.exe)
2007-08-01 15:29:00
Previous Post <- Tool : WCF Configuration Editor ( SvcConfigEditor.exe) This tool is a useful assistant in any activity which involves metadata of the service. Some of the useful operations which this tool can perform are : Generate client code from metadata including client config file. Metadata can be fetched from service by this tool and metadata stored in files can also be used. Export Metadata from compiled service implementation code or running services - useful when you don't want to expose metadata through your hosted service in production. To validate compiled service code using the configuration file - what could be the actual usage scenario for this ? This tool can be found in following directory <Installation_Drive>:Program FilesMicrosoft SDKsWindowsv6.0Bin Some of the important switches/options which can be used with this tool are : /mergeConfig : As this tool overwrites the existing files, this switch can be used to merge with existing f...
More About: Utility
* Tool : WCF Configuration Editor ( SvcConfigEditor.exe)
2007-07-31 11:07:00
Previous Post <<- WCF : Developing a basic WCF Client and Service The Windows Communication Foundation (WCF) Service Config uration Editor is an excellent tool to create and manage WCF configuration stored in XML files. Some of the features include : It works exclusively on <system.serviceModel> section of the config file and do not impact or gets impacted on by other sections of the file. It comes with wizard to create new config files in a very logical manner for both services and clients. Its a GUI based tool which makes it very easy to manage and understand config files. It comes with IntelliSense and so reduce the chances of typo errors. For mentioning the class and Interface names it allows to browse & load the actual assembly and then select the type names which again reduces the chances of typo errors. Allows to manage all the sections of <system.serviceModel> including behaviors, bindings, client, services, diagnostics etc. Located at follow...
More About: Tool , Gedit
More articles from this author:
1, 2, 3, 4
50298 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2008 - Supported by Web Catalog - SEO by FeWorks
eXTReMe Tracker