Posts Tagged ‘70-536’

Interoperation - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

CLS-compliant Exception – Any exception object managed by the .NET Framework. All CLS compliant exception derives from the System.Exception hierarchy. CLS stands for Common Language Specification.

COM (Component Object Model) – Prior to .NET, COM was the fundamental development framework from Microsoft.

COM Callable Wrapper (CCW) – A proxy class that sits between a .NET assembly and a COM component and that allows the COM component to consume the .NET assembly.

Interoperation, interop – managed and unmanaged code working together.

Managed Code – Code that is managed by the .NET Framework runtime.

Marshaling – Moving type data across different execution environments.

Memory Leak – The problem of resource leakage related to memory that is not reclaimed.

Platform Invoke – A mechanism used to call unmanaged code from managed code.

Runtime Callable Wrapper (RCW) – A proxy class that sits between a .COM component and a .NET assembly and that allows the .NET assembly to consume the component.

Type Library Exporter – A tool used to export a >NET type to COM

Type Library Importer - A tool used to import a COM type into .NET

Type Safety – Verification of a given type so that mismatches cannot occur.

Rating: 3.0/10 (1 vote cast)

Instrumentation - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

Attribute – A specific class type in the .NET framework that allows for declarative binding of code.

Debug – A specific constant defined in an application that allows debugger objects to be attached to code.

Debugger – A class that provides access to the default debugger attached to an application

Event log – A mechanism that allows an application to record information about its state and persist it permanently.

Management Query – A request for information about a Windows Management Instrumentation object.

Performance Counter – A mechanism to measure performance of code that is executing.

Process – An application that is currently running. Processes allow for resource isolation.

StackTrace – An ordered collection of one or more StackFrame objects.

Windows Management Instrumentation – A technology that provides access to information about objects in a managed environment.

Rating: 0.0/10 (0 votes cast)

Installing and Configuring Applications - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

Application Setting – A custom setting that the application reads, writes, or both.

Configuration Management – The practice of handling and managing how an application is set up and configured.

Connection String – A specific value used by an application to connect to a given database. All ODBC and OleDb compliant databases use a connection string. For security those should always be encrypted.

.NET Framework 2.0 Configuration Tool (Mscorcfg.msc) – A tool provided by the .NET framework that allows visual configuration and management of applications and assemblies.
http://msdn.microsoft.com/en-us/library/2bc0cxhc(VS.80).aspx

Roll back – An action taken in cases where an installation does not complete successfully. To roll back means to undo any changes made up until the point of failure so that the machine is returned to the state is was in prior to the installation attempt.

Uninstall – Getting rid of any remnants of an application so that the machine looks identical to how it would have had the application never been installed.

Rating: 0.0/10 (0 votes cast)

Application Domains and Services - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

Application domain – A logical container that allows multiple assemblies to run within a single process, while preventing them from directly accessing another assembly’s memory.

Assembly evidence – Evidence that an assembly presents that describes the assembly’s identity, such as the hash, the publisher, or the strong name.

Defense-in-depth – The security principle of providing multiple levels of protection so that your system is still protected in the event of vulnerability.

Evidence – The way an assembly is identified, such as the location where the assembly is stored, a hash of the assembly’s code, or the assembly’s signature. The information that the runtime gathers about an assembly is then used to determine which code groups the assembly belongs to. The code groups, in turn, determine the assembly’s privileges.

LocalService – A service account that runs with very limited privileges

LocalSystem – A service account that runs with almost unlimited privileges.

NetworkService – A service account that is capable of authenticating to remote computers.

Service – A process that runs in the background, without a user interface, in its own user session.

Rating: 10.0/10 (2 votes cast)

Threading - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

Threading in C#
http://www.albahari.com/threading/
C# Programmer’s Reference Threading Tutorial
http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx

Summary:
The advantage of threading is the ability to create applications that use more than one thread of execution. For example, a process can have a user interface thread that manages interactions with the user and worker threads that perform other tasks while the user interface thread waits for user input.

Code Example (C#):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
        static void Main(string[] args)
        {
            ThreadStart starter = new ThreadStart(counting);
            Thread first = new Thread(starter);
            Thread second = new Thread(starter);
 
            first.Start();
            second.Start();
 
            first.Join();
            second.Join();
 
            Console.Read();
        }
 
        static void counting()
        {
            for (int i = 1; i <= 10; i++)
            {
                Console.WriteLine("Count: {0} - Thread: {1}", i, Thread.CurrentThread.ManagedThreadId);
                Thread.Sleep(10);
            }
        }

Asynchronous Programming Model – A pattern of working with specific types of .NET classes that use begin/End method pairs to provide asynchronous execution of certain methods.

Thread – A single synchronous line of execution of code.

Mutex - A synchronization primitive that can also be used for interprocess synchronization. Used to synchronize threads.
http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx

Semaphor - Limits the number of threads that can access a resource or pool of resources concurrently. Used to throttle threads.
http://msdn.microsoft.com/en-us/library/system.threading.semaphore.aspx

Timer – a basic object that will fire off an asynchronous call to a method based on time. There are three Timer classes. System.Threading.Timer, System.Windows.Forms.Timer and the System.Timers.Timer

Windows Kernel Objects – Operating system provided mechanisms that perform cross process synchronization. These include mutexes, semaphores, and events.

Rating: 0.0/10 (0 votes cast)

Searching, Modifying, and Encoding Text - 70-536 Study Guide: Key Terms

Monday, November 3rd, 2008

Code Page – A list of selected character codes in a certain order, these pages are usually defined to support specific languages or group of languages that share a common writing systems.
http://www.unicode.org/

Regular Expression – A regular expression (regex) is a way of describing a string of text using metacharacters or wildcard symbols.
http://en.wikipedia.org/wiki/Regular_expression
Regular Expressions Cheat Sheet (V2)
http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/
When validating input, always begin regular expressions with an “^” character and end them with “$”. This system ensures that input exactly matches the specified regular expression and does not merely contain matching input.
To check a Regex use:

1
2
3
//Replace the ^def$ with your expression and you’re good to go.
String s = MatchMe;
Regex.IsMatch(s, “^def$”);

Unicode – A massive code page with tens of thousands of characters that supports most languages and scripts, including Latin, Greek, Cyrillic, Hebrew, Arabic, Chinese, and Japanese.
http://en.wikipedia.org/wiki/Unicode

Rating: 0.0/10 (0 votes cast)

Input/Output (I/O) - 70-536 Study Guide: Key Terms

Friday, October 24th, 2008

Deflate – An industry standard for compressing data that is efficient, commonly used, and patent free/

File system – The operating-system-provided mechanism for storing files in folders and drives. Can be accessed using FileSystemInfo, DriveInfo, FileInfo, and DirectoryInfo.

File system watcher – provides methods for monitoring file system directories for changes. It can monitor:

  1. Changed
  2. Created
  3. Deleted
  4. Renamed

Code Example (C#):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
   FileSystemWatcher watcher = new FileSystemWatcher();
            watcher.Path = @"c:\";
 
            watcher.Created += new FileSystemEventHandler(watcher_Changed);
            watcher.Deleted += new FileSystemEventHandler(watcher_Changed);
            watcher.Changed += new FileSystemEventHandler(watcher_Changed);
            watcher.Renamed += new RenamedEventHandler(watcher_Renamed);
            watcher.Error += new ErrorEventHandler(watcher_Error);
 
            watcher.EnableRaisingEvents = true;
            watcher.IncludeSubdirectories = true;
        }
 
        static void watcher_Changed(object sender, FileSystemEventArgs e)
        {
            Console.WriteLine("({0}): {1}", e.ChangeType, e.FullPath);
        }
 
        static void watcher_Renamed(object sender, RenamedEventArgs e)
        {
            Console.WriteLine("({0}): {1}", e.OldFullPath, e.FullPath);
        }
 
        static void watcher_Error(object sender, ErrorEventArgs e)
        {
            Console.WriteLine("{0}", e.GetException());
        }

Isolated Storage – A protected place in a user’s system to store data without requiring high-level rights to an application and that is scoped by user, assembly, or application

Code Example (C#):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
     //Writing an IsolatedStorageFile
 
            IsolatedStorageFile userStore = IsolatedStorageFile.GetUserStoreForAssembly();
            IsolatedStorageFileStream userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Create, userStore);
            StreamWriter userWriter = new StreamWriter(userStream);
            userWriter.WriteLine("User Perfs");
            userWriter.Close();
 
 
            //Reading from an IsolatedStorageFile
 
            string[] files = userStore.GetFileNames("UserSettings.set");
            if (files.Length == 0)
            {
                Console.WriteLine("No data saved for this user.");
            }
 
            userStream = new IsolatedStorageFileStream("UserSettings.set", FileMode.Open, userStore);
            StreamReader userReader = new StreamReader(userStream);
            string contents = userReader.ReadToEnd();
 
            Console.WriteLine(contents);

Gzip – Standard extension to deflate compression algorithm that allows for a header to carry additional information.

Rating: 2.9/10 (9 votes cast)

Framework Fundamentals - 70-536 Study Guide: Key Terms

Thursday, October 16th, 2008

Boxing – Enabling a value type to be treated as an object.
Code Example (C#):

1
2
3
4
5
6
7
//Boxing
int a = 123;
 
//Unboxing
b = 123;
a = (int)b;  // unboxing
object b = (object)a;  // boxing

Cast – A conversion from one type to another.
Code Example (C#):

1
2
3
double a = 1.3425;
int b;
b = (int)a; //Cast double to an int

Constraint – A condition on a type parameter that restricts the type argument you can supply for it. A constraint can require that the type argument implement a specific interface, be or inherit from a specific class, have an accessible parameter less constructor, or be a reference type or a value type.

Contract – A common set of members that all classes that implement the interface must provide.

Exception – The base class which contains an error message and other application data. The .NET framework defines hundreds of exception classes to describe different events, all derived from System.SystemException.
http://www.developerfusion.com/article/1889/exception-handling-in-c/3/
Code Example (C#):

1
2
3
4
5
6
7
8
9
10
	Try
	{ }
	Catch (System.IO.FileNotFoundExecption ex)
	{
		Console.WriteLine(“The file could not be found. “);
	}
Catch (Exception ex)
	{
		Console.writeLine(“Error reading file:+ ex.Messsage);
	}

Filtering Exceptions – A process used to filter through multiple exception classes and allow different responses depending on the exception. This can be achieved by using the Try, Catch and Finally Method.

Garbage Collection – A process were the runtime manages the memory used by the heap. Garbage collection recovers memory periodically as needed by disposing of the items that are no longer referenced.

Generic Type – A single programming element that adapts to perform the same functionality for a variety of data types.
Generic Type Parameters (C# Programming Guide)
http://msdn.microsoft.com/en-us/library/0zk36dx2(VS.80).aspx
Benefits of Generics (C# Programming Guide)
http://msdn.microsoft.com/en-us/library/b5bx6xee(VS.80).aspx

Heap – An area of memory where the actual data that address refers to is stored.

Interface - A common set of members that all classes that implement the interface must provide.

Narrowing – Happens when a value is converted from one type to another when the destination type can’t accommodate all possible values from the source. For example narrowing would happen when a double is type cast to an int.

Nullable type – A type of variable that can be used to determine weather a value has not been assigned, it allows the value to store a null value. If a bool type is Nullable then it can have a value of true, false, or null.
Code Example (C#):

1
2
3
4
Nullable b = null;
 
		//Shorthand notation, only for C#
		bool? b = null;

Signature – The return type, parameter count, and parameter types of a member.

Stack – Where instances of value types are stored in memory. Where the runtime can create, read, update and remove them quickly within minimal overhead.

Structure – User-defined types are also called structures or simply Structs. User-defined types are stored on the stack and they contain their data directly. In most other ways, structures behave nearly identical to classes.

Structure types should meet all of these criteria:
• Logically Represents a single value
• Has an instance size less than 16 bytes
• Will not change after creation
• Will no be cast to a reference type

Code Example (C#):

1
2
struct Person
{ }

Unboxing – Converting back from a reference type to a value type after boxing has occurred.
Code Example (C#):

1
2
3
//Unboxing
b = 123;
a = (int)b;  // unboxing

Widening – The opposite of narrowing when a value is converted to a different type where the destination type can accommodate all possible values from the source type. Widening would occur when an int is type cast to a double.

Rating: 2.6/10 (43 votes cast)

Mail - 70-536 Study Guide: Key Terms

Wednesday, October 15th, 2008

Multipurpose Internet Mail Extensions (MIME) – A standard that enables binary data to be published and read on the internet. The header of a file with binary data contains the MIME type of that data. This informs client programs (such as web browsers and e-mail clients that they cannot process the data as straight text.

http://en.wikipedia.org/wiki/MIME

Code Example (C#):

1
2
3
MailMessage m = new MailMessage();
Stream st = new FileStream(@”c:\boot.ini”, FileMode.Open, FileAccess.Read);
m.Attachments.Add(new Attachment(st, “myFile.txt”, MediaTypeNames.Application.Octet));

Secure Sockets Layer (SSL) – A standard that uses public-key encryption to protect network communications. SmtpClient.EnableSsl is new in the .NET 2.0 framework.

Simple Message Transfer Protocol (SMTP) – The standard clients use to transmit e-mail messages to mail servers and mail servers use to transmit messages between themselves. In the .NET framework, the SmtpClient class represents the SMTP server.

Code Example (C#):

1
SmtpClient client = new SmtpClient(“smtp.yourdomain.com);
Rating: 0.0/10 (0 votes cast)

Reflection - 70-536 Study Guide: Key Terms

Wednesday, October 15th, 2008

Module – A single container for types inside an assembly. An assembly can contain one or more modules.

Multifile Assemblies – A logical container for different parts of the data the CLR (Common Language Runtime) needs to execute code. One file in the assembly must contain the assembly manifest. An assembly that starts an application must also contain an entry point. (A main method)

Reasons to use multifile assemblies:

  • To combine modules written in different languages. This is the most common reason for creating a multifile assembly.
  • To optimize downloading an application by putting seldom-used types in a module that is downloaded only when needed.
  • To combine code modules written by several developers. Although each developer can compile each code module into an assembly, this can force some types to be exposed publicly that are not exposed if all modules are put into a multifile assembly.

Note: Multifile assemblies can have only one entry point, even if the assembly has multiple code modules.

http://msdn.microsoft.com/en-us/library/168k2ah5(VS.71).aspx

Satellite Assemblies – A .NET Framework assembly containing resources specific to a given language. Using Satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language.

Rating: 0.0/10 (0 votes cast)