I ran across another post of someone looking to get rid of WCF on StackOverflow today. The post titled “WCF replacement for cross process/machine communication” goes into the typical complaints about configuration of WCF. I actually think this is the least of the issues I’ve had with WCF. Whatever your reason for looking to abandon WCF, this post is for you. A step-by-step walk-through to get up and running with protobuffers over Win32 rpc.


continue reading @ http://csharptest.net/1177/wcf-replacement-for-cross-processmachine-communication/
 
 
NLog is a .NET library which enables you to add sophisticated tracing code to your application, delivering the functionality mentioned above and much, much more.

NLog lets you write rules which control the flow of diagnostic traces from their sources to targets, which could be:

  • a file
  • text console
  • email message
  • database
  • another machine on the network (using TCP/UDP)
  • MSMQ-based message queue
  • Event Log
  • and others, described here
In addition, each tracing message can be augmented with pieces of contextual information, which will be sent with it to the target. The contextual information can include:

  • current date and time (in various formats)
  • log level
  • source name
  • stack trace/information about the method that emitted the tracing message
  • values of environment variables
  • information about exceptions
  • machine, process, and thread names
  • and many more, as described here
Each tracing message is associated with a log level which describes its severity. NLog supports the following levels:

  • Trace - Very detailed log messages, potentially of a high frequency and volume
  • Debug -Less detailed and/or less frequent debugging messages
  • Info - Informational messages
  • Warn - Warnings which don't appear to the user of the application
  • Error - Error messages
  • Fatal - Fatal error messages. After a fatal error, the application usually terminates.
NLog is an open source library distributed at no cost under the terms of the BSD license, which permits commercial usage with almost no obligation. You can download the NLog binary and source code releases from its website. A graphical installer is also provided, which lets you install NLog in a preferred place, and enables integration with Visual Studio 2005 (Express editions are also supported), including:

  • configuration file templates
  • Intellisense for NLog config files
  • code snippets
  • Add Reference... dialog integration
 
 
Coming of Age
With version 4.0 of the .NET Platform, Microsoft will release its second version of the Entity Framework, which will include a raft of new features, making it a viable option for use in real-world applications. (As of this writing, the first Community Technology Preview is available for Entity Framework 4.0, which runs on .NET 4.0 Beta 1 with Visual Studio 2010.)
 
1.       Persistence Ignorance: You can define your own POCO’s (Plain Old CLR Objects) that are decoupled from any specific persistence technology. This allows you to swap out one data access stack for another should the need arise.

 

2.       T4 Code Generation: EF 4 will ship with a number of T4 code-generation templates which you can customize or replace with your own. (T4 is a code-generation technology built into Visual Studio 2008 or later.)

 

3.       Lazy Loading: In addition to eager and explicit loading, related entities can be loaded automatically on demand. For example, with an Order class that has an OrderDetails property, marking this property as virtual will cause order details to be loaded from the database automatically when the OrderDetails property is enumerated.

 

4.       POCO Change-Tracking: EF4 will support two models for tracking changes on POCO’s. By default EF will take a snapshot of the original state of your objects and then compare it to the current version when saving changes. Alternatively, you can define properties as virtual so that their state is continually tracked and kept in sync with the object state manager.

 

5.       Better N-Tier Support with Self-Tracking Entities: The first CTP for EF4 includes a T4 template for generating entities that track their own changes on the client, which are then serialized when sent across service boundaries and saved to the database.

 

6.       Model-First Development: Create a model for your entities, then have Visual Studio 2010 generate DDL to create a database with matching tables and relations.

 

7.       Code-Only Development: Write classes and have EF infer a conceptual model (no edmx file!). You can even generate DDL from the dynamic model to create the database and tables.

In addition to these features, EF 4 will include a number of other improvements, such as singularization and pluralization of entity names (for example, when creating a model for the Northwind sample database), an enhanced entity model designer, complex type support, inclusion of foreign keys in the entity model, additional functions and operators for LINQ queries, testability improvements with IObjectSet<T>, and better readability / performance for generated SQL.
 
 

I’ve been working with both ASMX and WCF web services for about 2 years now. And although according to Microsoft, WCF is designed to replace all previous communication technologies, but some people are still creating web services using ASMX including me.

It’s known that WCF will provide the functionality of WS-* standards in an easier way than previously was possible. But as these standards were not supported on most development platforms and provide features that are not needed by default in most of the web services. Most of the services are using SOAP basic profile which can be implemented using both WCF or plain old ASMX.

Here is a comparison between using both technologies to create a web service with basic profile binding:

Feature ASMX WCF Comments
Easy to learn and code Both have similar attributes that are added to service and data classes
Easy to configure   WCF adds a hell of configuration keys with different options that mostly are not useful
Easy to deploy   With the complex configurations and options of WCF, its relatively hard process to deploy a WCF service
Easy to browse and test   ASMX services provide a page to easily browse the services operations and enable users to test these operations from the browser.
It also shows a full sample of the SOAP HTTP message to call the service simplifying the life for developers who are trying to send these requests manually (mostly because their development platform doesn’t support it)
Easy to debug errors   Using WCF introduces a set of ambiguous exceptions that maximize the complexity of working with the technology.
Compatibility with older .NET Frameworks   Trying to call a WCF service from .NET Framework 1.1 or 2.0 is a bad scenario
ASP.NET Context In WCF this is off by default, so you have to add some compatibility configurations to be able to access the ASP.NET context which contains: Cache, Session, Cookies, Request headers specially host address
Support for JSON data format Both added JSON support in .NET 3.5 to support calling the service from javascript
Support for WS-* standards   A plus for WCF where it will be a very big hassle to work with WS-* with ASMX
Support for binary data format   Although it’s not recommended but it could be useful for bandwidth to use binary instead of XML with WCF
Support for REST   Don’t confuse REST with JSON as REST is the way HTTP requests are sent with parameters in URLs and using multiple HTTP actions instead of just GET.

I’m not sure that ASMX doesn’t support REST so if anyone has more information please post your comments.
Intercepting messages across the service/client   WCF support creating code that run in certain events to intercept messages and process them across all service operations.

This is not available in ASMX and could be useful in certain complex scenarios like doing custom authentication, authorization, logging and routing techniques.
Customizing client side functions   WCF enables you to take the service interface through a class library and use it to call the service without adding a service reference (using a dynamic channel factory). This allows using the same data classes in both the service and client, making it possible to include functionality in these classes (like caching, validation or auto calculated properties) that can be used on the client side.

This can’t be done using ASMX as it can only be called from the web reference which creates a copy of the data classes (taking only fields that are transferred on wires) without any functionality that was on the service classes.

After this comparison, my recommendation is the following: if you are using SOAP Basic Profile which is the most probable, always use ASMX for it’s simplicity and ease of use unless you need a feature that only exists in WCF. This will save you a lot of trouble.

Note: Another tip, if you are already using WCF with the default binding wsHttpBinding and you are not making use of any special feature of this binding (using only features like old ASMX). It’s better to change this binding to httpBasicProfile as this will greatly enhance the performance of your service.

In later posts, I’ll try to explain some of the above topics with how to and code samples.

 
 
DOM Monster is a bookmarklet, created by Thomas Fuchs of script.aculo.us, for analyzing the DOM and several other features of a page.

It works cross-platform/browser, checks the HTML + JavaScript codes and can come with warnings/suggestions like:
  • Reduce the number of tags that use the style attribute (85 elements)
  • Found 16 JavaScript globals. Reducing them can increase performance
  • and more..
The bookmarklet is not an all-in-one solution, however, can be used side-to-side with other tools like Firebug, PageSpeed, YSlow, etc.

Also, it is open source and can be improved/customized further.

 
 
 
 

از امروز شما هیچ چیز را برای موقعیّت های خاص نگذارید. زیرا هرروز زندگی یک موقعیّت خاص است.

در جست و جوی دانش باشید. بیشتر بخوانید. در ایوان بنشینید و منظره را تحسین کنید بدون آنکه توجّهی به نیازهایتان داشته باشید.

زمان بیشتری را با خانواده و دوستانتان بگذرانید. غذای مورد علاقه تان را بخورید و جاهایی را که دوست دارید، ببینید. زندگی فقط حفظ بقا نیست بلکه زنجیره ای از لحضه های لذّت بخش است!

از جام کریستال تان استفاده کنید. بهترین عطرتان را برای روز مبادا نگه ندارید و هر لحظه که خواستید به دست بگیرید.

عبارتی مثل" یکی از این روزها" و یا "روزی" را از فرهنگ لغت خود خارج کنید.بیایید نامه ای را که قصد داشتیم یکی از این روزها بنویسیم همین امروز بنویسیم.

بیایید به خانواده و دوستانمان بگوییم که چقدر آن ها را دوست داریم.

هیچ چیزی را که میتواند به خنده و شادی شما بیفزاید را به تأخیر نیندازید.

هر روز،هر ساعت و هر دقیقه لحظه ای خاص است و شما نمیدانید شاید آن میتواند آخرین لحظه باشد.

 

    Programming

    Mahdi Yousefi,
    I love computer programming.  asp.net web forms and mvc based websites.

    Archives

    April 2012
    January 2012
    March 2011

    Categories

    All
    Component
    Developer
    Dotnet
    Entityframework
    Nlog
    Programming
    Video
    Wcf
    Web
    Webservice
    Youtube