why is configuration is more important in modern applications?
- Customization: Organizations more likely to develop feature rich, general purpose product addressing public, then according to client specification they customize the product, turn off/on special features.
- Externalization: It gives advantage of changing software without rebuilding it,and not setting up build environment, build manager etc.
- Centralization of variable parts: putting variable parts in centralized external places. Instead of looking through code to change, and debugging we put it in well known location
- Simplifying change: In order to change configuration of most software, per say xml, one doesn’t have to be programmer and know implementation language, detail etc.
- Ease of administration: After product is shipped, product is mostly under administrator’s responsibility. To admin the product, one has to see the configuration only, not whole code etc.
Web crawler catalog
http://www.searchtools.com/robots/robot-code.html
Found this one and wrote one by myself in C#, basically they are the same
What is the difference between foreground and background thread?
• Foreground threads have the ability to prevent the current application from terminating. The CLR will not shut down an application (which is to say, unload the hosting AppDomain) until all foreground threads have ended.
• Background threads (sometimes called daemon threads) are viewed by the CLR as expendable paths of execution that can be ignored at any point in time (even if they are currently laboring over some unit of work). Thus, if all foreground threads have terminated, any and all background threads are automatically killed when the application domain unloads.
Object initializer syntax
now we can use {} for object initializer such as Point p=new Point{X=1,Y=2};
Also quite the similar to anonymous methods, there is anonymous class
Partial methods
Partial methods are methods living in partial classes which are marked as partial and has to return void, can have non out argument and implicitly private.
Extended methods
We could’t add methods unless you use reflection etc, prior to C# 2008.(Though we can use visitor pattern here:)) Now we can do that using extended methods. It can be inside only static classes and this should be the first keyword of parameters.
for example:
static class TesterUtilClass
{
// Every Int32 now has a Foo() method…
public static void Foo(this int i)
{ Console.WriteLine(“{0} called the Foo() method.”, i); }
// …which has been overloaded to take a string!
public static void Foo(this int i, string msg)
{ Console.WriteLine(“{0} called Foo() and told me: {1}”, i, msg); }
}
Also it has direct access to ther classes. For example:
using System;
using System.Collections.Generic;
using System.Text;
namespace MyExtensionMethods
{
public class Car
{
public int Speed;
public int SpeedUp()
{
return ++Speed;
}
}
public static class CarExtensions
{
public static int SlowDown(this Car c)
{
return –c.Speed;
}
}
}
Automatic properties
It can be defined as
public String MyName{get;set;}
where get set body is not defined. There is no read only or write only automatic property, since they are automatically generated.. If it is an abstract then the class needs to be abstract.
Implicit typing
C# it uses var keyword, and the variable must be initialized non null statement (since compiler needs to know which type it is referring) at the time of declaring. Also it has to be used as local variable, not field, return value or parameters etc. It can’t be nullable, since its type has to be known.
Declaration of MulticastDelegate which is default base class of delegates should include
public string Invoke(bool a, bool b, bool c);//which has to match with delegate function signature
public IAsyncResult BeginInvoke(bool a, bool b, bool c,AsyncCallback cb, object state);//Above plus callback.
public string EndInvoke(IAsyncResult result); //get the results.
but if the delegate includes ref or out method the EndInvoke method has to include the them.
-
Recent
-
Links
-
Archives
- August 2009 (1)
- July 2009 (2)
- April 2009 (4)
- March 2009 (6)
- February 2009 (5)
- January 2009 (4)
- December 2008 (3)
- November 2008 (35)
- October 2008 (20)
-
Categories
-
RSS
Entries RSS
Comments RSS