Perfil de ambatiProgramming Myself.. Amb...FotosBlogListasMás Herramientas Ayuda

Blog


28 agosto

List of IOC frameworks and Containers

List of self-proclaimed Inversion of Control frameworks and containers

C++

QtIocContainer

Autumn Framework

ColdFusion

ColdSpring Framework

ColdSpring Framework

ColdSpring uses an Inversion-of-Control pattern and an Aspect-Oriented-Programming (AOP) framework for ColdFusion components (CFC).

Groovy on Grails

Groovy on Grails uses Spring Framework to initialize the application.

Spring Framework

Java

Programmers using the Java programming language have applied Inversion of Control in an Inversion of Control Container (Martin 2004). The software requests an object from the container and the container builds the object and its dependencies. The ATG Dynamo application server was one of the first environments to leverage this approach, while more recent examples of these containers include HiveMind, PicoContainer, Spring Framework (note that Spring is a complete enterprise platform, not just an IoC container), Apache Excalibur, Seasar, Guice and DPML Metro.

.NET

   Spring.NET

   ObjectBuilder

   StructureMap

   Castle Project

   Seasar

   Ninject

 

PHP4

drip

PHP5

Garden

Python

PyContainer

Ruby

copland

needle

 

Dependency injection (DI) is a programming architectural model, sometimes also referred to as inversion of control or IOC although, technically speaking, dependency injection specifically refers to an implementation of a particular form of IOC.

Description

Dependency Injection describes the situation where one object uses a second object to provide a particular capacity. For example, being passed a database connection as an argument to the constructor instead of creating one internally.

The term "Dependency injection" is a misnomer, since it is not a dependency that is injected, rather it is a provider of some capability or resource that is injected.

The pattern seeks to establish a level of abstraction via a public interface, and to remove dependency on components by (for example) supplying a plug-in architecture. The architecture links the components rather than the components linking themselves or being linked together. Dependency injection is a pattern in which responsibility for object creation and object linking is removed from the objects themselves and transferred to a factory. Dependency injection therefore is inverting the control for object creation and linking, and can be seen to be a form of IoC.

There are three common forms of dependency injection: setter-, constructor- and interface-based injection.

Dependency injection is a way to achieve loose coupling. The technique results in highly testable objects, particularly when applying test-driven development using mock objects: Avoiding dependencies on the implementations of collaborating classes (by depending only on interfaces that those classes adhere to) makes it possible to produce controlled unit tests that focus on exercising the behavior of, and only of, the class under test. To achieve this, dependency injection is used to cause instances of the class under test to interact with mock collaborating objects, whereas, in production, dependency injection is used to set up associations with bona fide collaborating objects.

Existing frameworks

Dependency Injection frameworks exist for a number of platforms and languages including:

ActionScript

§  Syringe

C++

§  Autumn Framework

§  QtIocContainer

ColdFusion

§  ColdSpring Framework

Java

§  Azuki

§  iPOJO

§  Google Guice

§  HiveMind

§  JBoss Microcontainer

§  PicoContainer

§  Seasar

§  Spring Framework

§  JEE 5 / EJB 3

.NET

§  Castle MicroKernel/Windsor

§  ObjectBuilder

§  PicoContainer.NET

§  Puzzle.NFactory

§  Spring.NET

§  StructureMap

§  Ninject

Perl

§  The IOC Module

Python

§  PyContainer

Ruby

§  Copland

§  Needle

 

Implicit invocation is used by some authors for a style of software architecture in which a system is structured around event handling, using a form of callback. It is closely related to Inversion of control and what is known informally as the Hollywood Principle.

The idea behind implicit invocation is that instead of invoking a procedure directly, a component can announce (or broadcast) one or more events. Other components in the system can register an interest in an event by associating a procedure with the event. When the event is announced the system itself invokes all of the procedures that have been registered for the event. Thus an event announcement implicitly causes the invocation of procedures in other modules.

 

 
24 agosto

active listening and passive listening and why is listening so important

Taken from Prakash J

(Here I refers to Prakash)

 

I attended a training on Giving and Receiving feedback 2 days back and one of the topics covered was effective listening. We discussed about active listening and passive listening and why is listening so important?.

 

We get into discussions and meetings everyday and I feel that it’s a common problem. I was looking for more information on this topic and found the following in a book.

 

Why is listening such a problem for most people? We assume that listening, like speaking, is a skill that we master as we grow up. But active listening takes the same effort as developing and refining our speaking skills.

 

Often, as we grow up, we actually develop bad listening habits, ignoring what others are saying because we:

·         Consider the subject dull or too complicated. We tune out a speaker because we feel the subject will be boring or, even worse, fear that we will be unable to understand what the person is saying.

·         React, not to the speaker’s words, but to the speaker’s appearance or mannerisms. Consequently, we don’t hear the good ideas.

·         Overreact. Our enthusiasm or anger can color what we hear.

·         Listen only for facts. We need to give all our attention to a speaker to understand the full message.

·         Fake attention. Many people are so happy with their ability to “act interested,” that they use the skill when they actually should be paying attention.

·         Tolerate or create distractions. Doodling, interrupting, and turning the pages of a book or a magazine are all distracting actions that should not be done or tolerated.

·         Daydream. We need to teach ourselves not to allow our minds to wander— to remain focused on the subject at hand.

·         Disagree. When we disagree with a speaker, we get so involved in formulating our response that we don’t always hear all of the speaker’s points.

 

The author explains how to overcome this problem.

If you think you have one or all of these problems, it’s time to make some notes on just how good or bad your listening is. Begin by keeping paper and pen handy and making a list of specific listening errors you catch yourself making.

Each time you note a specific listening error you’ve made, try to recall what you were doing at the time that caused the error. As you remember and visualize the cause, categorize the error under one of the above habits. By keeping a careful record, you may discover the listening mistakes you make most often. Work, then, to avoid these. Fortunately, we can break our bad listening habits, but before we can do that, we need to be aware that they exist.

 

From the book: The Essential New Manager's Kit

  

17 agosto

Conditional Compilation Calls in .Net

.Net will take care of not compiling the unnecessary code in release mode.

It won’t generate IL code for the code which was placed under conditional compilation call.

It will generate code in debug mode only.

 

MARS (Multiple Active Result Set) and How to encrypt web.config

MARS (Multiple Active Result Set)

http://blogs.ittoolbox.com/c/coding/archives/mars-multiple-active-result-set-16003

MARS is a new feature in ado.net 2.0 and Sql Server 2005 that allows for multiple forward only read only result sets.

MARS allows you to avoid seeing the dreaded "There is already an open DataReader .." exception when executing on separate SqlCommands associated with the same connection. You can have multiple SqlDataReaders open on a single connection (again, each reader must be started on a new SqlCommand) and you don't have to worry about Transaction isolation level scope locks

Advantages of MARS

MARS provides the following advantages:

It provides a lighter weight alternative for applications that use multiple connections to overcome lack-of-MARS limitations. However, this is not always the case because multiple connections do provide parallel execution in the server (provided they're not enlisted in the same transaction).

It enables multiple SqlDataReaders. Prior to MARS, only one command or resultset could be active at one time on a connection. This required the use of two or more connections to execute multiple queries. As the code example showed, MARS allows you to execute multiple queries against a single connection. However, note that MARS does not enable parallel execution of queries; it enables only sequential execution of multiple queries.

Factors to consider while using MARS

1) Statement Interleaving


MARS operations execute synchronously on the server. Even though statement interleaving of SELECT and BULK INSERT statements are allowed, data manipulation language (DML) and data definition language (DDL) statements execute atomically. Any statements attempting to execute while an atomic batch is executing will be blocked.

For example, if you submit two batches under a MARS connection, with one containing a SELECT statement and the other containing a DML statement, the DML can begin execution within the execution of the SELECT statement. However, the DML statement must be completed before the SELECT statement can continue its execution. If both statements are running under the same transaction, any changes made by a DML statement after the SELECT statement has started execution are not visible to the read operation.

2) MARS Session Cache

When you open a connection with MARS enabled (which is the default case), a logical session is created; this adds additional overhead. SqlClient will cache a MARS session within a connection to minimize the overhead and enhance performance. The cache and sessions contained in it are per connection-they are not shared across connections. The cache will contain at most 10 MARS sessions. This value is not configurable. If the session limit is reached, a new session will be automatically created without throwing an error. When a session is released, it is returned to the pool so that it can be re-used. However, the session will be released to the pool only when the pool's upper limit is not reached. Otherwise, the session is closed.

3) Thread Safety

MARS operations are not thread safe.

4) Connection Pooling

MARS-enabled connections also support connection pooling and are pooled like any other connection. However, MARS-enabled connections and MARS-unaware connections are not considered the same. Because of that, they are kept in separate connection pools. For example, if an application opens two connections, one with MARS enabled and one with MARS disabled as the only distinction, the two connections will be in separate pools.

 

http://blogs.msdn.com/sqlprogrammability/archive/2006/05/01/MARSIntroduction1.aspx

Introducing Multiple Active Result Sets (MARS) (1)

MARS is a new programming interface introduced in SQL Server 2005. It enables multiple result sets to exist at the same time for a given connection. To say it in a simple way, you can make a connection to server and then submit multiple requests to server at the same time, and then read results from these requests in whatever way you want, and you don’t get “connection busy” error any more!

 

Sounds wonderful, right? But wait! Before you dive into MARS, there are a lot of things you need to be aware. I will give a series of talks about how to use MARS correctly. This first talk gives you three basic things you need to keep in mind, and there will have more later on.

 

First you need to understand what a unit of work is from server and from client point of view.

 

From client application point of view, you send a ‘command’ to server, call Execute() on the ‘command’, and then retrieve result(s) from it. The result can be a data set, a scalar value, or maybe with error/warning messages. So the unit of work, from client point of view, is a command, or a request.

 

But once the command is sent to server, server treats it differently. SQL Server thinks the request is a batch of statements. And server processes these statements one by one, without taking the fact that they are sent in one batch into account too much. And server decides whether or not MARS is allowed by looking at the actual statement running in the two requests, not at batch granularity. Please keep this in mind as this helps you understand MARS better later on.

 

 

Second you need to understand the difference between sending multiple requests to server inside one connection/session and sending multiple requests to server through different connections/sessions.

 

If you send multiple requests through one connection to server, then these requests can share connection wide resources, such as database context, security context, transaction, set options, cursors, local temporary tables etc. But multiple requests sent through different connections cannot share these connection specific resources.

 

Why do you need to care about these shared resources? Well, it is always good to share, but you need to make sure you are not messing up all these shared resources by changing the shared state randomly in your requests. For example, you have a table t1 defined in two databases, DB1 and DB2, and the connection is currently in DB1. Then you send two requests to server:

            Request 1:

                        UPDATE t1 set col1=2

                        USE DB2

                        UPDATE t1 set col2 = ‘3435’

 

            Request 2:

                        UPDATE t1 set col2 = ‘3333’

                        INSERT t1 values (10, ‘5555’)

                       

Since you are changing database context in the middle of one request by using USE <DBNname> statement, it is clear that you want the statements following that USE statement to run under the new database, but which database do you expect your second request to run under, DB1 or DB2?

 

I will talk about how to make sure you are not causing in-deterministic behavior in later talk. This is to just give you an initial thinking.

 

The third thing you need to understand is that multiple active requests are not actually running in parallel, they are running in an interleaving way. From client application point of view, server supports running multiple requests in parallel, and client can pull result from multiple requests at their will. But at server, out of multiple requests sent to server, only one request can actually make progress at a given time, other requests have to wait for this request to give up its connection resource.

 

So when would a request give up its connection resource? When the request writes result to network and is waiting for client to pull the result from server. Take a simple example, you send two SELECT requests to server in two SqlCommand object that are in the same connection,

            // create two commands that are in the same connection conn1

            SqlCommand cmd1 = new SqlCommand(“SELECT * FROM DB1.dbo.t1”, conn1, …);

            SqlCommand cmd2 = new SqlCommand(“SELECT * FROM DB2.dbo.t1”, conn1, …);

 

            // Send the two requests to server

            SqlDataReader* reader1 = cmd1.ExecuteReader();

            SqlDataReader* reader2 = cmd2.ExecuteReader();

 

            // Read all results from first command

            while (reader1->Read())

                        Console::WriteLine(reader1->GetString(1));

 

            // Read all results from second command

            while (reader2->Read())

                        Console::WriteLine(reader2->GetString(1));

 

After you sent cmd1.ExecuteReader(), server starts to run the command SELECT * FROM DB1.dbo.t1, and it sends the result to client, since client is not reading the result yet, server thread is blocked in writing packets, so it gives up the connection resource to let other request in the same connection to run. Now cmd2.ExecuteReader() picks up the connection resource, run the SELECT, and sends result to client. Since now client tries to read result from first command, the server thread that processes second SELECT is again blocked, so it gives up the connection resource to let first SELECT continue to run.

Now client wants to read all results from first command, so server keeps sending the result to client until it reaches the end. When the first request finishes, it again gives up the connection resource to let the second request continue to run to the end.

 

http://blogs.msdn.com/sqlprogrammability/archive/2006/06/23/MARSCloneMerge.aspx

 

Introducing Multiple Active Result Sets (MARS) (2)

MARS is a powerful tool, but you may shoot yourself by the foot if you don't use it correctly. In the following several talks, I will talk about how to use MARS safely. This talk will cover the session/request context management. In later talks, I will cover transaction usage, security context usage and yield/resume logic, etc.

 

As I said in the first post, if you send multiple requests to server in one session, these requests share the same session level context, such as current session database, security setting, transaction, set options (transaction isolation level, for example) and other resources such as cursors, handles, local temporary tables etc. But how exactly SQL Server implements the sharing?

 

Server uses different mechanisms for different kinds of session context or resource to be shared.

  1. Clone/Merge. Session keeps one master copy of the context, and each running request keeps its own copy of the context. The synchronization of the session and request copy is done at beginning and end of a request by doing clone and merge. Most session contexts are using this mechanism as explained below.
  2. Protected access to session. All requests running in a session share the same copy of information, and any access to the shared information are protected in some way. Transaction context, security context, and other session level resources like cursor, prepared handle etc are falling into this category. The detail of this will be covered in next post.

 

This post will talk in detail about the clone/merge mechanism.

 

Session itself maintains all the contexts session has -- set options, current database, some session global values such as @@rowcount, @@error, etc. We call it the session environment. The environment values are changed as a result of executing some user request.

 

At the beginning execution of each request, the request makes a copy of session environment (we call clone). The request can make any change to these environment variables during execution, but these changes are kept local to the request, neither session nor other running request can see these changes. After the request is finished, all the environment values are copied back to the session (we call merge). If there are new requests started before this request copies its value back to session, the new request will get an old copy of the session context.

 

Most session context falls into this clone/merge category. They include:

   1. All the set options

   2. Session current database

   3. Session global variable -- @@error, @@rowcount, @@identity, etc

 

Example1: database context:

Suppose a session is current running in database DB1. One request starts and copies the database context from session, which is DB1. Now the request runs the following:

            UPDATE t1 SET col1 = 2      -- this will change table t1 in DB1

            USE DB2

            UPDATE t2 SET col1 = 3      -- this will change table t2 in DB2

 

While this request is running, the session’s current database stays as DB1 until the request merges its change back to session. If client submits another request

            UPDATE t1 SET col = 4

to server while the first request is running, and the new request reaches server before the first request finishes, then the new request will run in DB1, but if the new request reaches server after the first request is finished, then it will run in DB2. As you may already figured out, this is very risky – we may change data in a database we don’t intent to, and cause database corruption!

 

Example2: SET Options

If one request changes XACT_ABORT setting in the middle of its execution, then another request that is submitted to server after this request may or may not get to run under this new setting depend on different aspects, and the error handling policy will be different for the new request. This may cause surprise for you – in your testing environment you get one behavior, and in your production environment you get another behavior, simply because your database grows bigger.

 

Example3: @@ values

The @@values are copied back from request to session at the end of the request. When you check @@ values inside a request immediately after a statement, like this:

                        -- the two statements are in one request(batch)

                        UPDATE t1 SET col1 = 1

                        SELECT @@rowcount

you are getting the value from the request’s local environment copy, so it can reflect the value you expect. But if you submit the two statements from two batches:

                        -- first request sent to server  

UPDATE t1 SET col1 =1

 

                        -- second request sent to server after the first request

                        SELECT @@rowcount

 

Then whether or not the @@rowcount can reflect the UPDATE result depends on:

  1. Whether or not the SELECT starts to run AFTER first request is finished, and
  2. Whether or not there are other requests running in the same session in the mean time.

 

The bottom line

So what do you need to keep in mind because of this clone/merge semantics?

 

You should always change session level settings including set options and database context with multiple result sets open. As the examples above shown, it is very hard for client to control when exactly the change you made in one request will affect other requests, so server may end up processing a request under the wrong settings.

 

As you will understand in my next post, when exactly the changes you made in one request will be reflected in session is affected by different factors -- your result set size, network packet size, how client code consumes the result set, etc. So unless you know very well what you are doing, do not make session scope change with multiple requests running.

 

 

http://www.asp.net/learn/data-access/tutorial-73-vb.aspx

 

Protecting Connection Strings and Other Configuration Information

Using aspnet_regiis.exe

The .NET Framework includes a variety of command line tools in the $WINDOWS$\Microsoft.NET\Framework\version\ folder. In the Using SQL Cache Dependencies tutorial, for instance, we looked at using the aspnet_regsql.exe command line tool to add the infrastructure necessary for SQL cache dependencies. Another useful command line tool in this folder is the ASP.NET IIS Registration tool (aspnet_regiis.exe). As its name implies, the ASP.NET IIS Registration tool is primarily used to register an ASP.NET 2.0 application with Microsoft’s professional-grade Web server, IIS. In addition to its IIS-related features, the ASP.NET IIS Registration tool can also be used to encrypt or decrypt specified configuration sections in Web.config.

The following statement shows the general syntax used to encrypt a configuration section with the aspnet_regiis.exe command line tool:

aspnet_regiis.exe -pef section physical_directory -prov provider

section is the configuration section to encrypt (like “connectionStrings”), the physical_directory is the full, physical path to the web application’s root directory, and provider is the name of the protected configuration provider to use (such as “DataProtectionConfigurationProvider”). Alternatively, if the web application is registered in IIS you can enter the virtual path instead of the physical path using the following syntax:

aspnet_regiis.exe -pe section -app virtual_directory -prov provider

The following aspnet_regiis.exe example encrypts the <connectionStrings> section using the DPAPI provider with a machine-level key:

aspnet_regiis.exe -pef "connectionStrings" "C:\Websites\ASPNET_Data_Tutorial_73_VB" -prov "DataProtectionConfigurationProvider"

Similarly, the aspnet_regiis.exe command line tool can be used to decrypt configuration sections. Instead of using the -pef switch, use -pdf (or instead of -pe, use -pd). Also, note that the provider name is not necessary when decrypting.

aspnet_regiis.exe -pdf section physical_directory -- or -- aspnet_regiis.exe -pd section -app virtual_directory

Note: Since we are using the DPAPI provider, which uses keys specific to the computer, you must run aspnet_regiis.exe from the same machine from which the web pages are being served. For example, if you run this command line program from your local development machine and then upload the encrypted Web.config file to the production server, the production server will not be able to decrypt the connection string information since it was encrypted using keys specific to your development machine. The RSA provider does not have this limitation as it is possible to export the RSA keys to another machine.

By default, files with a .config extension in an ASP.NET application cannot be accessed through a browser. These types of files are not returned because they may contain sensitive information, such as database connection strings, usernames and passwords, and so on. The protected configuration system in .NET 2.0 helps further protect sensitive information by allowing specified configuration sections to be encrypted. There are two built-in protected configuration providers: one that uses the RSA algorithm and one that uses the Windows Data Protection API (DPAPI).

In this tutorial we looked at how to encrypt and decrypt configuration settings using the DPAPI provider. This can be accomplished both programmatically as well as through the aspnet_regiis.exe command line tool, which was covered in Step 3.

 

Windows Live Skydrive

Windows Live Skydrive in BETA

Microsoft steals inovation over Google! it has now released a public BETA of erstwhile Live Folders TODAY... this is an open BETA available in the US, UK, and India.
this is now called Windows Live SkyDrive: http://skydrive.live.com/ . so head over there and get your 500 MB of online space NOW!
This feature update includes the following:
· An upgraded look and feel – new graphics to go along with your new features!
· “Also on SkyDrive” – easily get back to the SkyDrives you’ve recently visited
· Thumbnail images – we heard you loud and clear, and now you can see thumbnails of your image files
· Drag and drop your files – sick of our five-at-a-time upload limit? Drag and drop your files right onto your SkyDrive
· Embed your stuff anywhere – with just a few clicks, post your files and folders anywhere you can post html
You can find more detail at team blog: http://skydriveteam.spaces.live.com/
Another first is inclusion of India in the BETA release.. i think it may very well be the first product that has launched in India alongwith US!

Add files to your space!

Along with our release this morning, we’re also proud to announce a new feature of Windows Live Spaces: add your files to your space!

To get started, simply sign in to Spaces and click Share files on the What’s New page!

Once added, your Files module will automatically show your visitors only the folders to which they have access. It’s a great one-stop shop for all the stuff you’re sharing.
 

Visual Studio(Rosario) , REST , Astoria ,Jasper ,Silverlight ,Java to DotNet Part2

http://dotnetwithme.blogspot.com/2007/08/what-new-in-visual-studio-rosario-aug.html

What's new in Visual Studio (Rosario) Aug CTP

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

 

http://dotnetwithme.blogspot.com/2007/06/silverlight-360-degree-overview.html

* Silverlight : A 360 degree overview

Background

  • Code named as "WPF/E" which is Windows Presentation Foundation/Everywhere. Published as extension to WPF framework which is a new UI representation technology based on markup language called XAML.
  • WPF has a capability of rendering high quality graphics and media.
  • WPF has been structured in such a way that designers and developers can work independently and later integrate their work seamlessly.

Objective / Mission

  • To deliver platform which can be used to render Rich Interactive Applications (RIA) on client side in browsers similar to Flash but with much more capabilities.
  • To be browser and platform independent.
  • Lightweight so that it can be downloaded quickly.
  • Use the existing technologies to develop applications for this platform.
  • Ability to deliver rich media experiences.
  • Ability to get .net code downloaded in client browser and execute it within browser space without requiring .NET CLR on desktop.

Product / Support

  • Current browsers supported are Internet Explorer (versions 6.0 and 7.0), Firefox 2.0 and Safari on Windows and Mac.
  • Currently two different versions available 1.0 beta which supports XAML rendering engine and 1.1 alpha which supports executing managed code in browser.
  • Sdk is available for both the available versions and add-in is available for Visual Studio 2008 beta.
  • Plugin sizes for windows are :  1.0 beta is approx 1.4 MB and 1.1 alpha is approx 4 MB.

Implementation

  • Silverlight control is an ActiveX control for windows which includes a subset version of .NET CLR called Silverlight CLR.
  • Silverlight CLR is a subset of desktop CLR and based on Desktop CLR 2.0. It doesn't expose functionality like Remoting, File IO, CLR hosting etc.
  • While a process can host only one version of desktop CLR at one time, Silverlight CLR has been modified so that multiple CLR version can be hosted in Silverlight control.

Development

  • Development Tools available for developing Silverlight applications are : Expression Studio and Visual Studio 2008 Beta.
  • Silverlight based application mainly consists of XAML code for UI and .NET code for client side programming like validations. Silverlight application gets downloaded to client browser before execution.
  • Expression studio can be used for designing UI and generating XAML and Visual Studio for writing functional code.
  • Silverlight control and other code on a web page can talk to each other using DOM model. Like Javascript and ASP.NET code can talk to Silverlight based code and vice-versa.
  • Silverlight code can interact with client file system only through an isolated storage and a file upload control.

 

 

 

* Java to DotNet (.NET) Migration - Options, Approaches and Tools

http://dotnetwithme.blogspot.com/2007/08/java-to-dotnet-net-migration-options.html

 

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 /IIOP

Enterprise Services, Remoting, WCF

EJB Container

Enterprise Services, IIS, WAS

Session EJB

Enterprise Services, Remoting, WCF

Entity EJB - CMP

No equivalent

Entity EJB - BMP

Serviced components with DataSets

Database / Integration Layer

JDBC

ADO.NET :
Connected : Data readers
Disconnected : DataSets

JMS

MSMQ, System.Messaging, WCF

JCA

Biztalk

Runtime, Language & Others Components

jdk

.NET BCL

JRE

CLR

Packaged as .jar

Assembly( dll,exe, module)

JAXB

XML Serialization, XSD Tool

JAXP

System.XML

Development tools

Visual Studio Team System - complete ALM

Documentation

SandCastle

 

MIGRATION PATHS

Currently three options are available for migrating java aps to .net :

  • Tool : Java Language Conversion Assistant (JLCA) - This tool is from Microsoft and currently is in Version 3.0. It takes java source code files and converts them to CSharp files. It also creates projects and support classes wherever direct mapping between jdk and BCL is not available. While over the period it has improved a lot but still its not 100% and some manual modifications will be required after conversion.
  • Visual J#.NET :  Its an another managed language from Microsoft which has syntax very similar to Java and provide libraries with functionality similar to jdk 1.1.4. Recommended if you plan to continue using existing java development skills but not recommended for interoperability with other managed applications.
  • jbimp : This tool comes with J# installation and can be used to convert byte code in .class files directly to MSIl assemblies. Its a good option for simple class files and uses J# libraries internally.

All the above tools assist in moving java apps to .net but there are limitations with each of them. If you plan to automate this process, you may have to write some custom tools to fill the gaps.

If you plan for a staged migration, java to .net interoperability options can also be used like web services, remoting bridges, etc. so that whole of app need not be converted at one go.

 

Thanks & Regards,

Sreedhar Ambati

http://ambatisreeedhar.spaces.live.com

  

Visual Studio(Rosario) , REST , Astoria ,Jasper ,Silverlight ,Java to DotNet Part1

Today in one of the blogs I saw a word “REST”

As I went into depth I found some interesting stuff ie “Astoria”.

After reading the document I felt that Microsoft may not release the products on time but their vision is  excellent.

 

http://dotnetwithme.blogspot.com/2007/06/rest-vs-rest.html

REST is an acronym standing for 'Representational State Transfer'.  Its an architecture style for network-based software systems first proposed by Roy Fielding in 2000.

This architecture style is mainly recommended for network based software systems which do not have complex requirements at both server and client end. An example of complex need will be, client should be able to send complex queries to host over web for retrieval of data. An example of simple requirement will be requesting a static html page from server.

The objective of this style is to design systems in as simple manner as possible to give them maximum scalability and ease of use.

The main features of 'REST' style of architecture are :

  • All resources should be available over http protocol.
  • Every resource should have a fixed named URI like http://productcompany/details/product1.
  • Stateless : All request from client to server should have enough formation so that server doesn't need to track requests from same client. This is to achieve maximum scalability.
  • Cache : Clients should be capable to cache responses where ever possible so that network trips can be avoided.
  • All interactions between client and server should happen using only following commands : GET, POST, PUT and DELETE.
  • All resources should have hyperlinks which can take client to details.

The best example of REST style architecture is classic Web with static HTMLs linked to each other.

REST is called 'Representational State Transfer' because as client moves from resource to other its state changes where the resource is accessed using named URI.

Although it was mainly recommended for accessing static data over web but with web becoming programmable through web services, it is now being compared with SOAP which is a style of transferring resources/data using web services.

Although web services can be designed in both REST and SOAP style, they are recommended in different kinds of problem space.

REST believes in fast and simple, so it should be used to build web services which are more oriented towards simple CRUD style of transactions but no or very less security requirements.

SOAP gives the power of tightly coupled systems to loosely coupled systems and is recommended for building complex, secure and robust network-based systems.

A very recent implementation of RESTful web services is 'Astoria' data services framework released by ADO.NET team at Microsoft.

 

 

 

 

http://oakleafblog.blogspot.com/2007/04/enables-restful-data-services.html

 

"Astoria" Enables RESTful Data Services

Pablo Castro's new blog's first post is Codename "Astoria": Data Services for the Web describes the ADO.NET team's new incubation project codenamed "Astoria."

Astoria is the topic of Pablo's MIX07 presentation:

Accessing Data Services in the Cloud
Speaker: Pablo Castro - Microsoft
Audiences: Designer, Developer

Come learn about new Microsoft technologies that enable you to make your data available over the Web through a simple REST interface and using open formats such as plain XML, JSON or even RDF. We also discuss the underlying entity framework that makes it easy to model, publish, and program against your data over the Web.

Update 5/3/2007: The video of Pablo's presentation is XD006 - Accessing Data Services in the Cloud.

Note: That's one of the members of LINQ-Related Sessions at MIX 07. I mentioned that Pablo Castro promised "to put a Web spin on the Entity Framework, which might include a side trip for LINQ to Entities." It turns out that I was right.

The project currently offers an Astoria toolkit for Orcas Beta 1 and a read-only demonstration of Astoria online services for various data sources, such as the Northwind and AdventureWorks sample databases, Encarta articles, and anonymous TagSpace items.

In the future, you'll be able to create your own experimental online data services and temporarily host them on the astoria.mslivelabs.com Web site.

According to the documentation, which you can download from the Astoria Web site:

Project Astoria consists of a combination of patterns, libraries and an online service that explores the concept of data services for the web. Currently, Astoria data services use relational databases as the underlying store, but in general the nature of the store does not surface in the Astoria interfaces.

The goal of Astoria is to facilitate the creation of flexible data services that are naturally integrated with the web. As such, Astoria uses URIs to point to pieces of data and simple, well-known formats to represent that data, such as JSON and plain XML. This results in the data service being surfaced to the web as a REST-style resource collection that is addressable with URIs and that agents can interact with using the usual HTTP verbs such as GET, POST or DELETE.

In order for the system to understand and leverage semantics over the data that is surfacing, Astoria models the data exposed through the data service using a model called the Entity Data Model (EDM), an Entity-Relationship derivative. This organizes the data in the form of instances of "entity types", or "entities", and the associations between them. ...

Currently Astoria can represent data in plain XML, JSON (JavaScript Object Notation) and in a subset of RDF+XML.

The default representation format is XML. This is not a specific format; it is a fixed mapping of the entity structure to XML elements, with some added semantics to make use of the information provided by the EDM schema.

The team is considering adding RSS and ATOM to the data formats.

Astoria data services rely on the Windows Communication Framework (WCF), Entity Data Model, and Entity Framework. Here's a brief excerpt from the FAQ page:

Q: What is the relationship between Astoria and Windows Communication Foundation (WCF)?
A: All Astoria data services are essentially WCF services. You can see Astoria data services as a special form of WCF service that is aware of the nature of the data that is exposing.

Q: What is the relationship between Astoria and the Entity Data Model (EDM)?
A: Astoria data services uses the EDM as the model for the data exposed through its services. Having a high-level data model allows Astoria to provided added semantics to the service, such as having a clear definition of what an “entity” is for a given service or how to navigate from one entity to another associated entity.

Q: What is the relationship between Astoria and the ADO.NET Entity Framework?
A: Astoria exposes data modeled as EDM models. The ADO.NET Entity framework is the natural choice for an infrastructure that already supports the EDM and through mapping technology can present relational stores in EDM terms. The Astoria runtime that sits in the web servers and serves the requests to data services is built on top of the ADO.NET Entity Framework.

I plan to test the toolkit later this week and will add links to posts with my results here.

This is the second of the promised MIX07 announcements of projects that take advantage of the Entity Framework, which was recently cut from the Orcas release of Visual Studio. The first is here.

http://astoria.mslivelabs.com/

The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over HTTP, and URIs are used to identify the various pieces of information available through the service. Interactions with the data service happens in terms of HTTP verbs such as GET, POST, PUT and DELETE, and the data exchanged in those interactions is represented in simple formats such as XML and JSON.

http://dotnetwithme.blogspot.com/2007/05/jasper-on-fly-data-access-using-entity.html

* Jasper : On the fly data access using Entity Objects

Writing data access layer is mandatory activity of any database aware application development. But it also seems to be least interesting phase as it involves lot of repetitive code or the phase whose output is not a finished product and so does not mean much to external world. Over the period lot of techniques have evolved to minimize the efforts which are spent on developing the Data Access Layer like :

  • Generating code based on db schema.
  • Writing a generic data access layer which reads the queries and data object metadata from config files.

The ADO.NET team is working on a new technology which simplifies the things beyond the above two.

Microsoft Code Name "Jasper" is a new framework which utilizes the capabilities of LINQ and Entity Framework of ADO.NET to create data access classes on the fly without any generation of code which needs to be compiled.

Jasper can be configured either to emit types which are directly mapped to each table in database or emit types which represent the domain objects. The Entity Framework of forthcoming ADO.NET is utilized to provide O/R mapping.

As utilizing types which are created at runtime involves late binding, currently only Visual Basic 9 and IronPython1.1 are supported. Still some of the features of Jasper can be used using C# also which i will cover in coming posts.

The earliest "Jasper" can come out for production is as part of 2nd release of Orcas which will contain the Entity Framework.

Jasper will also support data binding with GUI controls.

Jasper April 2007 CTP is available for download and requires Visual Studio 'Orcas' beta .

Following pseudo code will give some idea about it works :

string connectionString = "Database connection details";

context = DynamicContext.CreateDynamicContext(connectionString);

Query1 = context.Table1

resultList = Query1.Where(column1="A");

foreach result in resultList

Print (result.column1)

Next

 

Windows Process Activation Service (WAS)

Windows Activation Service  (WAS)

IIS is usually thought of as a Web server, hosting Web pages and applications served up to Web browsers over the HTTP protocol. With IIS 6.0, IIS introduced Application Pools – a powerful runtime container that defined the process boundary around Web sites and applications, their process identity, as well as several other recycling, activation and shutdown behaviors. Application Pools are a powerful tool for Web administrators for isolating applications and managing them for health.

IIS7 has generalized the immensely powerful HTTP process activation model that IIS 6.0 introduced with Application Pools, and has made it available for all protocols. This protocol independent service is called the "Windows Process Activation Service". The Windows Communication Foundation ships with protocol adapters that can leverage the capabilities of the "Windows Process Activation Service". This can dramatically improve the reliability and resource usage of WCF services. This whitepaper walks you through a very basic WCF service that uses the "Windows Process Activation Service".

http://www.iis.net/articles/view.aspx/IIS7/Hosting-Web-Applications/Windows-Communication-Foundation--WCF-/Writing-a-Web-Service-hosted-in-IIS7

The IIS 7 components available on these Editions serve as supporting infrastructure for Microsoft's Windows Communication Foundation (WCF.) Collectively the IIS 7 components that provide this infrastructure are referred to as the Windows Process Activation Service (WAS.) Users who install WCF based applications will not need to explicitly install WAS, rather these components will be installed by WCF as needed.

In IIS 7.0, Windows Activation Service (WAS) manages application pool configuration and worker processes instead of WWW Service. This enables you to use the same configuration and process model for HTTP and non-HTTP sites.

Additionally, you can run WAS without WWW Service if you do not need HTTP functionality. For example, you can manage an Indigo Web service through a listener, such as NET.TCP, without running the WWW Service if you do not need to listen for HTTP requests in HTTP.sys.

 

Windows Process Activation Service Samples

http://msdn2.microsoft.com/en-us/library/ms751535.aspx

 

chanakya' quotes

 

From Saai

Chanakya's Quotes - Worth reading a million times…



***************************************************
 


"A person should not be too honest.


Straight trees are cut first

and Honest people are victimised first."

Chanakya quotes (Indian politician, strategist and writer, 350 BC 75 BC)
 


***************************************************
 


"Even if a snake is not poisonous,


it should pretend to be venomous."

Chanakya quotes (Indian politician, strategist and writer, 350 BC-275 BC)
 


***************************************************

 


"The biggest guru-mantra is: Never share your secrets with anybody. ! It will destroy you."


Chanakya quotes (Indian politician, strategist and writer, 350 BC-275 BC)
 


***************************************************

 


"There is some self-interest behind every friendship.
There is no Friendship without self-interests.
This is a bitter truth."


Chanakya quotes (Indian politician, strategist and writer, 350 BC-275 BC)
 


***************************************************

 


"Before you start some work, always ask yourself three questions - Why am I doing it, What the results might be and Will I be successful. Only when you think deeply
and find satisfactory answers to these questions, go ahead."


Chanakya quotes (Indian politician, strategist and writer, 350 BC-275 BC)

   
***************************************************
 


"As soon as the fear approaches near, attack and destroy it."


Chanakya quotes (Indian politician, strategist and writer, 350 BC-275 BC)

 
***************************************************
 


"Once you start a working on something,


don't be afraid of failure and
don't abandon it.

People who work sincerely are the happiest."

Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)

 
***************************************************

 
"The fragrance of flowers spreads
only in the direction of the wind.
But the goodness of a person spreads in all direction."

Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)
 


***************************************************

 


"A man is great by deeds, not by birth."


Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)

 
***************************************************
 


"Treat your kid like a darling for the first five years.


For the next five years, scold them.
By the time they turn sixteen, treat them like a friend.
Your grown up children are your best friends."

Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)
 


***************************************************

 


"Books are as useful to a stupid person


as a mirror is useful to a blind person."

Chanakya quotes (Indian politician, strategist and writer, 350 BC-275BC)

   
***************************************************

 
"Education is the best friend.
An educated person is respected everywhere.
Education beats the beauty and the youth."

Chanakya quotes  (Indian politician, strategist and writer, 350 BC-275BC)

 

16 agosto

Independence Day Orphanage House

Yesterday
I went to an orphanage house. 

Innovative Ideas

 

Can you tell me some innovative ideas that are in your mind which will revolutionize the existing technology?

 

Gaurav told me these:

Online operating system

Intelligent Compiler which should detect common bugs and fix them.

Sendhil want this:

XML Aware hardware, we are going to need this.

Prakash Somasundaram want this:

          A self healing application. If an exception occurs due to the data or what ever condition, we manully correct it. When it’s manually corrected the system should learn from it and if the same exception occurs again it should correct it by itself. It’s a step just above robust programming.

If you want to add some more you can tell me..

 

 

13 agosto

Data Models

 
I got this link for different datamodels from Sendhil.
 
08 agosto

Organise the Using statement in visual studio 2008

using statement organization.

Yes Now we can select all the using statements and ask the studio to organize it.

 The studio will sort the statement in the order of their name.

The better thing was the ability to remove the unused using statement.

Select the using statements rightclick->OrganizeUsing->Remove Unused Usings.

This will remove all those using statements that are not required in the page.

It will improve the overall code of a normal developer

Reference:

(http://www.vikramlakhotia.com/Deactivation_the_Window_Vista_Aero_colour_scheme.aspx)

 

 

 

07 agosto

Links for wcf ,sqlnotification services

http://www.typemock.com/Docs/TestPatterns.html

http://www.dotnetjunkies.com/WebLog/richardslade/archive/2005/08/17/131994.aspx

http://www.codeproject.com/csharp/TestNonPublicMembers.asp


http://www.codeproject.com/csharp/lambdaexpressions.asp


http://www.tokiva.com/rates.php


Jon Flanders' Web-based Atlas Workflow Designer
www.masteringbiztalk.com/atlasworkflowdesigner/
http://www.theserverside.net/tt/articles/showarticle.tss?id=ManageAppProcesses  Brian Noyes

http://community.bartdesmet.net/blogs/bart/archive/2006/08/27/4278.aspx
http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,5880f478-b448-4c39-9f2e-382d942a7b82.aspx

http://www.theserverside.net/tt/articles/showarticle.tss?id=ManageAppProcesses
http://odetocode.com/Articles/default.aspx
http://odetocode.com/Articles/447.aspx
http://barcampbangalore.org/wiki/BCB4_Collectives#FOSS_in_the_Enterprise_Collective

http://msdn2.microsoft.com/en-us/library/bb266709.aspx intgrating wcf and wwf
http://msdn2.microsoft.com/en-us/library/aa480213.aspx     rehosting wwf desinger
=======================


http://weblogs.asp.net/gsusx/archive/2005/10/05/426699.aspx  wcf persistance
https://www119.livemeeting.com/cc/mseventsbmo/viewReg
http://msdn2.microsoft.com/en-us/library/bb266709.aspx  integrating wcf and wwf

http://www.impactevents.com/biztalkconference/LabManuals.aspx  

http://www.codeproject.com/WF/XAML_WF.asp  goood one of wwf
http://www.codeproject.com/WF/JumpStartWF.asp  good for for wwf if else activity
http://aspnet.4guysfromrolla.com/articles/052604-1.aspx     hosting windows control in a web appl
http://www.impactevents.com/biztalkconference/LabManuals.aspx  explanations in a doc form
http://msdn.microsoft.com/architecture/rss/rssfoundationsworkflow.xml
http://msdn2.microsoft.com/en-us/architecture/aa480178.aspx         human workflow
http://www.codeplex.com/WinWf
http://msdn2.microsoft.com/en-US/library/ms735921.aspx
http://search.techrepublic.com.com/search/Webcast+and+workflow.html         good
http://msdn2.microsoft.com/en-us/library/ms734733.aspx     how to compile workflows
http://www.odetocode.com/Articles/455.aspx
http://dotnetslackers.com/articles/wf/WindowsWorkflowFoundationPart3.aspx   basic activities
http://searchvb.techtarget.com/generic/0,295582,sid8_gci1193920,00.html       best wwf
http://msdn2.microsoft.com/en-us/library/ms741699.aspx  wwf activiteis samples
http://blogs.msdn.com/markhsch/archive/2005/09/23/473373.aspx  dynamic update wwf

 

http://www.code-magazine.com/article.aspx?quickid=0605051&page=1
http://blogs.msdn.com/markhsch/archive/2005/09/23/473373.aspx

Abstract:
One of the really cool features of Windows Workflow Foundation is the ability to dynamically update a running workflow by inserting new activities or changing the properties of existing activities. All of this is done at runtime and really opens up some cool possibilities when you start looking at how you could apply this feature.
-----------

sqldependency notification services 2005
http://www.eggheadcafe.com/tutorials/aspnet/f3c54d02-702d-44df-9bd5-4a8530bde25f/caching-pages-and-

applica.aspx     good
http://dotnetslackers.com/articles/sql/TheSqlCacheDependencyClass.aspx
http://support.microsoft.com/kb/555893   windows application
http://www.devx.com/dotnet/Article/27865/0/page/1   webapplication

 

operator overloading c#

Overloadable Operators (C# Programming Guide)

C# allows user-defined types to overload operators by defining static member functions using the operator keyword. Not all operators can be overloaded, however, and others have restrictions, as listed in this table:

Operators Overloadability

+, -, !, ~, ++, --, true, false

These unary operators can be overloaded.

+, -, *, /, %, &, |, ^, <<, >>

These binary operators can be overloaded.

==, !=, <, >, <=, >=

The comparison operators can be overloaded (but see the note that follows this table).

&&, ||

The conditional logical operators cannot be overloaded, but they are evaluated using & and |, which can be overloaded.

[]

The array indexing operator cannot be overloaded, but you can define indexers.

()

The cast operator cannot be overloaded, but you can define new conversion operators (see explicit and implicit).

+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=

Assignment operators cannot be overloaded, but +=, for example, is evaluated using +, which can be overloaded.

=, ., ?:, ->, new, is, sizeof, typeof

These operators cannot be overloaded.

NoteNote

The comparison operators, if overloaded, must be overloaded in pairs; that is, if == is overloaded, != must also be overloaded. The reverse is also true, and similar for < and >, and for <= and >=.

To overload an operator on a custom class requires creating a method on the class with the correct signature. The method must be named "operator X" where X is the name or symbol of the operator being overloaded. Unary operators have one parameter, and binary operators have two parameters. In each case, one parameter must be the same type as the class or struct that declares the operator, as demonstrated in the following example:

public static Complex operator +(Complex c1, Complex c2)
 http://msdn2.microsoft.com/en-us/library/8edha89s(VS.80).aspx
------------------------
 

Lift your head high

Lift your head high

Where there is great difficulty, there are also great opportunities. Where there is sorrow, there is also much possibility for real joy.

In places of darkness, even a small light can make an enormous positive difference. When the situation seems hopeless, that's precisely when acting on hope can turn things around.

The greatest achievements often have their origins in the most complicated and perplexing problems. By accepting the possibility of dreadful failure, people are able to create magnificent success.

When it seems that no options remain, that's when a breakthrough is about to happen. Each setback along the way makes the eventual success that much more precious and valuable.

No matter how good or how difficult life may be now, there is always a realistic and accessible way to make it better. For you can learn, you can adapt, you can grow stronger, and you can take effective action to move forward.

Whatever may be, whatever may happen, lift your head high with thankfulness and enthusiasm. For when you so choose, the best is yet to come.

 

Solution to the daily problems

In Bangalore
Everybody speaks about Traffic problems.
But nobody encourages mass communication.
Why people are using cars instead of bikes?
They are going to offices in cars.It occupies more space.
If they are alone then why to use a car?
Nobody bothers about the society. 
02 agosto

Birthday

Today I entered into another interesting year.Now I entered into 27 
The day went very fine.
I am happy today through out the day.
Started a new concept "QueryObect Model using Nhibernate and Domain Specific Language"
I could able to speak with VV in phone after a long time.
 
01 agosto

Topics I read last week