madhavrao… » 2008 » March

Software Architecture is thought, designed, documented, described keeping its quality attributes in mind. There are different architecture styles like Layered system, Event based Implicit Invocation, Data abstraction and Object oriented organization and Pipe and Filter. Each have their own advantages and disadvantages which can be better explained using quality attributes. Quality attributes of the Software can be broadly classified into following categories:

  1. Runtime Qualities: These are class of qualities which can be measured when system executes.
  2. Non-Runtime Qualities: These are the qualities which are mainly concerned with usage of the software in long terms.
  3. Business Qualities: This are non-software qualities, but can have huge impact on software qualities in terms they are the one which decide which software qualities will gain importance and which can be compromised while designing.
  4. Architectural Qualities: These are the qualities specific to the architecture itself.

Few of the qualities along with their definition is covered in above mind map.

Share this post :

Enterprise Library 3.1 was published for Visual Studio 2005. Enterprise Library 3.1 can be divided into following parts:

  1. Library which works against .Net 2.0 and can also be used with applications developed with .Net 3.5
  2. Design time tool support both outside Visual Studio 2005 IDE as a standalone tool and inside Visual Studio 2005 as integrated tool.
  3. Software Factory to extend Application Blocks and create new Application Block

All of this would work with Visual Studio 2005 except Visual Studio IDE integrated tool for modifying configuration files. Patterns and Practice team has developed registry script which will change it.

To enable Enterprise Library Configuration Editor inside Visual Studio 2008, one would have to follow following steps:

  1. Run the registry script available at Codeplex
  2. Run “devenv /Setup” command from Visual Studio Command prompt.

Share this post :

The five built-in directives are:

  1. Assembly
  2. Import
  3. Include
  4. Template
  5. OutputĀ 

Assembly

The assembly directive identifies an assembly to be referenced so that you can use types within that assembly from code in the text template. Using the assembly directive is equivalent to using the Add Reference feature in Visual Studio.

In the following example, the directive name is assembly, the parameter name is name, and the parameter value is SomeLibrary.DLL:

<@ assembly name=”SomeLibrary.DLL” #>

Import

By using the import directive, you can refer to types in a text template without providing a fully qualified name.

In the following example, the directive name is import, the parameter name is namespace, and the parameter value is System.Diagnostics:

<#@ import namespace=”System.Diagnostics” #>

Include

The include directive processes text from the specified file as if that text were included verbatim in the template currently being processed. In the following example, the name of the directive is include, the parameter name is file, and the parameter value is C:\test.txt:

<#@ include file=”c:\test.txt” #>

Template

By using the template directive, you can specify characteristics of the generated transformation class, such as code language, class inheritance, culture, and the ability to debug. The template directive takes the following parameters, each of which is optional:

Parameter Default Value Acceptable Value Details
language C# C#, VB This parameter specifies which language, either Visual Basic or C#, has been used for code that is inside statement and expression blocks. All code that the engine generates in the transformation class must be expressed by using this language. The following example shows how to specify the Visual Basic language: <#@ template language=”VB”#>
inherits TextTransformation Any Class that derives from TextTransformation This parameter specifies which class should be used as the base class for the generated transformation class. The following example shows how to specify that the SomeClass class should be used:<#@ template inherits=”SomeClass”#>This concept is similar to ASP.Net Pages. Where markup is defined in aspx file and code behind is in .cs or .vb file or in some dll.
culture “”, the invariant culture A culture expressed as a string in the form xx-XX. For example, en-US, ja-JP, de-CH, de-DE, and others. This parameter specifies the culture to use when an expression block is converted to text.
debug true true, false This parameter specifies whether debugging is enabled. The following example shows how to enable debugging:
<#@ template debug=”true” #>
hostspecific false true, false This parameter is used only with custom hosts. If you set the value of this parameter to true, you can access a property called Host in your text template. The property is a reference to the object that hosts the engine. You should set hostspecific to true only if you want to write a text template that is specific to a custom host and the text template calls the host at execution time. When hostspecific is true and you are using Visual Studio, you can call GetService to update your text templates

Output

By using the output directive, you can specify characteristics of the generated text output, such as the file name extension. The output directive takes the following parameters, each of which is optional:

Parameter Default Value Acceptable Value Details
extension .cs Any string that satisfies the file systems rule for file extension. This parameter specifies the extension of the generated text output file. For example, you can specify a .cs or .vb extension if the generated text output is a code file. It is important to remember that the file name extension indicates only that the file is intended to be a particular format. The writer of the text template must make sure that the generated text meets the requirements of the intended format.<#@ output extension=”.txt” #>
<#@ output extension=”.htm” #>
<#@ output extension=”.cs” #>
<#@ output extension=”.vb” #>
encoding “Default”, the current ANSI code page of the system. Any of the following members of the Encoding class expressed as a string: Default, ASCII, BigEndianUnicode, Unicode, UTF32, UTF7, UTF8. This parameter specifies what encoding should be used when the generated text output file is created.<#@ output encoding=”ASCII”#>
<#@ output encoding=”UNICODE”#>
<#@ output encoding=”UTF8″#>

Share this post :

Directives and directive processors provide additional functionality to text templates. This functionality can be a simple as the ability to specify the extension of the output file or as complex as custom directive processors that read data from a database.

A directive processor contains one or more directives, and the same directive processor can process more than one directive. As an analogy, you can think of directive processors as classes, and you can think of directives as methods in those classes. You call directives directly from your text templates.

Example of Directives are:

  1. output: this is used to specify extension of the file.
  2. template: this is used to specify various properties of the template, one of which is language used to write control logic.

Directives can be classified into three types:

  1. Built-In Directives
  2. Generated Directives
  3. Custom Directives

Built-In Directives

Built-in directives are provided by the text template transformation toolkit. By using built-in directives, you can specify common options such as the programming language of the text template and the extension of the output file. There are five built-in directives: assembly, import, template, output, and include.

Generated Directives

Generated directives are based on the domain-specific language that you create. If you call a generated directive, you can access models from the statements and expressions in text templates.

Custom Directives

One can write custom directive processors to provide custom functionality to text templates. Custom directive processor can be used any time that one want to access external data or resources from a text template.

Different text templates can share the functionality that a single directive processor provides, so directive processors provide a way to factor code for reuse. The built-in include directive is similar, because you can use it to factor out code and share it among different text templates. The difference is that any functionality that the include directive provides is fixed and does not accept parameters. If you want to provide common functionality to a text template and allow the template to pass parameters, you must create a custom directive processor.

Some examples of custom directive processors could be:

  1. A directive processor to return data from a database that accepts a user name and password as parameters.
  2. A directive processor to open and read a file that accepts the name of the file as a parameter.