Advertuse

Search This Blog

Your Ad Here

Friday 24 October, 2008

.net 3.0/3.5 ફ્રેમવર્ક

.net 2.0 ફ્રેમવર્કમાં નીચેના નવા ચાર મોડયુલ ઉમેરતા .net 3.0 ફ્રેમવર્ક બને છે.
૧ WWF (વિન્ડો વર્કફલો ફાઉન્ડેશન )
૨ WCF (વિન્ડો કોમ્યુનીકેશન ફાઉન્ડેશન)
૩ WPF (વિન્ડો પ્રેઝનટેશન ફાઉન્ડેશન)
૪ CardSpace (કાડૅ સ્પેસ)
અને .net 3.0 મા LINQ (લીન્ક) મોડયુલ ઉમેરતા તે .net 3.5  ફ્રેમવર્ક બને છે.

તો ચાલો આપણે તેની પ્રાથમિક માહિતી મેળવીએ.

WWF (વિન્ડો વર્કફલો ફાઊંડેશન્ ) :
વિન્ડો વર્કફલો ફાઊંડેશન એટલે કોઇ કાર્ય કરવા માટે ના શ્રેણીબધ પગલા, નિર્ણય અને નિયમોનુ આલેખન
આજના આધુનીક સોફ્ટ્વેર યુગમાં, જ્યાં SOA(software oriented Architecture) એટલે કે સોફ્ટવેર ઑરીએંટેડ આર્કિટેક્ચર નો ઉપયોગ કરીને સોફ્ટવેર બનાવવામા આવે છે ત્યારે WWF ઘણુ ઉપયોગી નીવડે તેમ છે. કારણક SOA વાળા સોફ્ટવેરમાં business logic(ધંધા સૂઝ) અને તેનુ implementation (અમલીકરણ ) વચ્ચે સ્પષ્ટ ભેદરેખા જળવવી જરુરી છે. એટલે અંહિયા WWF નો ઉપયોગ business logic(ધંધા સૂઝ)નુ આલેખન કરવા માટે વાપરી શકાય છે. અને ત્યાર બાદ તેને કોઈ પણ .net એપલિકેશનમાં હોસ્ટ કરી શકાય છે. નીચે આપેલા નેમસ્પેસ(namespace)નો ઉપયોગ કરી નવા વર્કફલોના કોડિંગની કરી શકાય છે. માટે તેને નવા વર્કફલોના કોડિંગની ફાઇલમાં ઇન્ક્લૂડ કરવા જરુરી છે. 
using System.Workflow.ComponentModel.Compiler;  
using System.Workflow.ComponentModel.Serialization;  
using System.Workflow.ComponentModel;  
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;  
using System.Workflow.Activities;  
using System.Workflow.Activities.Rules;

૨ WCF (વિન્ડો કોમ્યુનીકેશન ફાઉન્ડેશન)

વિન્ડો કોમ્યુનીકેશન ફાઉન્ડેશન એટલે જુદી જુદી એપલીકેશન અથવા પ્રોસેસ વચ્ચેની આંતરી સંચાર વ્યવસ્થા માટેની સામાન્ય વ્યવસ્થા. જે SOA(software oriented Architecture) એટલે કે સોફ્ટવેર ઑરીએંટેડ આર્કિટેક્ચર ના અમલીકરણ વાળા સોફ્ટવેર માટે જરુરી છે. .NET 2.0 ની અંદર એપલીકેશન/પ્રોસેસ વચ્ચેની આંતરી સંચાર વ્યવસ્થા માટે નીચે જણાવેલ વ્યવસ્થા ઉપલબ્ધ છે.  
૧. SOAP પ્રોટોકૉલ વાળી વેબ સર્વિસ(web service) 
૨. બાઇનરી(binary)/શોપ્(SOAP)/કસ્ટમ(custom) પ્રોટોકૉલ વાળી ડોટનેટ રીમોંટીંગ્( .NET Remoting) 
3. transactional communications  
4. એસિંક્રોનસ કોમ્યુનિકેશન્ (MSMQ)
ઉપરોક્ત ચારે સંચાર વ્યવસ્થાના એકીકરણ કરીને વિન્ડો કોમ્યુનીકેશન ફાઉન્ડેશનની રચના કરવામા આવી છે. WCF ના ઉપયોગથી distributed application(ડિટ્રિબ્યુટેડ ઍપ્લિકેશન)ની આંતરી સંચાર વ્યવસ્થા ના કોડીંગ માટે મજબુત માળખુ પુંરુ પાડે છે. નીચે આપેલા નેમસ્પેસ(namespace)નો ઉપયોગ કરી નવા WCFનુ કોડિંગની કરી શકાય છે. માટે તેને WCFના કોડિંગની ફાઇલમાં ઇન્ક્લૂડ કરવા જરુરી છે.
using System.Runtime.Serialization 
using System.ServiceModel  
using System.ServiceModel.Configuration 
using System.ServiceModel.Description 
using System.ServiceModel.MsmqIntegration 
using System.ServiceModel.Security



Friday 10 October, 2008

WF .net 3.0/3.5

Workflow foundation is very handy tool to develop Service Oriented Architecture(SOA) base application on .net platform.
Main step to utilize WF in your any .net application are as follows.

Step 1. Create a workflow using standard activity or custom activity with help of workflow designer.

Step 2. Create a workflow runtime instance in any desire host application to run workflow inside your desire application like window application, console application, asp.net application, window service.

Workflow
workflow is the organize bunch of units called activity. which create the work model to resemble real word process. In other sense workflow is description of order of activity execution and relationship dependency of activity.


Mainly two type of workflow supported by .net framwork.
  1. Sequential Workflows
  2. State Machine Workflows
Sequential Workflow
It is rigid flow which contain loop and branches with condition and path through the workflow is deterministic.
State Machine Workflows
State machine workflows is composition of set of states, transitions, and actions. It is more event driven workflow. It wait for an event and trigger to change the new state.

there are many a ready made Activities given in Visual Studio

.net Remoting Config file of client side and server side

Client Config

Server Config
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown type="RemotableType, RemotableType" url="http://localhost:8989/RemotableType.rem" />
</client>
</application>
</system.runtime.remoting>
</configuration>


<configuration>
<system.runtime.remoting>
     <application>
           <service>
               <wellknown mode="Singleton"                  type="RemotableType, RemotableType" objectUri="RemotableType.rem" />
</service>
<channels>
<channel ref="http" port="8989"/>
</channels>
</application>
</system.runtime.remoting>
</configuration>

application tag has sub tag of client

application tag has sub tag of Service and Channel

Friday 26 September, 2008

.NET 3.0

.net 3.0 is nothing but the extension of .net 2.0 with following features
  • WWF - ( Window Work Foundation)
  • WCF - ( Window communication Foundation)
  • WPF - ( Window Presentation Foundation)
  • Silverlight( WPF/E)
  • Window Cardspace

  1. WWF ( Window Work Foundation)
WWF stand for Window Work Foundation. It is also know as workflow. It is a set of activities that stored as model that describes a real-word process. It is further divide as follow.
  • Activity Model
  • Workflow Designer
  • Workflow Runtime
  • Rules Engine
Activity Model
Activities are the building blocks of workflow, They are added to a workflow programmatically in a manner similar to adding XML DOM child nodes to a root node. When all the activities in a given flow path are finished running, the workflow instance is completed.
An activity can perform a single action, such as writing a value to a database, or it can be a composite activity and consist of a set of activities. Activities have two types of behavior: runtime and design time. The runtime behavior specifies the actions upon execution. The design time behavior controls the appearance of the activity and its interaction while being displayed within the designer

  • Workflow Designer: This is the design surface that you see within Visual Studio, and it allows for the graphical composition of workflows, by placing activities within the workflow model. You can find a screenshot of designing a sequential workflow here. One interesting feature of the designer is that it can be re-hosted within any Windows Forms application. Check out this article on MSDN to see how you can do this.
  • Workflow Runtime: Our runtime is a light-weight and extensible engine that executes the activites which make up a workflow. The runtime is hosted within any .NET process, enabling developers to bring workflow to anything from a Windows Forms application to an ASP.NET web site or a Windows Service.
  • Rules Engine: Windows Workflow Foundation has a rules engine which enables declarative, rule-based development for workflows and any .NET application to use. Here is an article which outlines the capabilities of the rules engine.

Wednesday 30 July, 2008

How to Download Embedded SWF files using Firefox

Hi Friends,


fllowing are the few steps to download embedded swf files using Firefox.



Step 1 : open the site which has embedded swf file





Step 2 : click on tool --> Page Info


.

Step:3 In Page Info click on media tab, and select embeed file and click on save as button.


Tuesday 29 July, 2008

Style button

hi friends,


Here i have develop a style button for winform in C#.net 2.0.


it is look like below images












to download it dll click below link
stylebutton.dll
and I will give full detail in next post

Tuesday 27 May, 2008

OOPS in Javascript for C#.NET developer

There three basic concept we found in OOPs
  1. Encapsulation (प्रावरण) (સંપુટીકરણ )
  2. Inheritance (धरोहर) (ધરોહર)
  3. Polymorphism (बहुरूपता ) (બહુરુપતા)
  • Encapsulation

Encapsulation conceals the functional details of a class from objects that send messages to it.
e.g. the Dog class has a bark() method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume). Timmy, Lassie's friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class Dog by code in that class. Members are often specified as public, protected or private in C#. Because JavaScript is not a statically typed language, it does not provide a keyword for defining a class or object-type definition. Additionally, because JavaScript is not compiled, there would be no way to enforce the proper use of such types. However, it is still possible to define custom objects in JavaScript that behave, in many ways, like classes in C# .

// C# Pet class
public class Pet
{ private string name;
public Pet(string name)
{
this.name = name;
}
public string GetName()
{
return name;
}
}

consume the C# code

Pet p = new Pet("Max");
System.Console.WriteLine(p.GetName());

// JavaScript Pet class
function Pet(name)
{
this._name = name;
}
Pet.prototype._name;
Pet.prototype.getName = function()
{
return this._name;
}

consume javascript class

var p = new Pet("Max");
alert(p.getName());

  • Inheritance
    Inheritance in object-oriented programming allows developers to define an "is a" relationship between classes. For example, we might want to extend our object model to define slightly more specialized versions of the Pet class: Dog and Cat. The base class, Pet, will contain any properties or methods shared by all Pets, but Dog and Cat may define additional properties or methods applicable only to instances of those classes. For example, our Dog class will provide a wag tail method, and the Cat class will provide a purr method.

// C# Dog class
public class Dog : Pet
{
public Dog(string name) : base(name)
{
}
public void WagTail()
{
// Wagging
}
}
// C# Cat class
public class Cat : Pet
{
public Cat(string name) : base(name)
{
}
public void Purr()
{
// Purring
}
}

consume C# code

Dog d = new Dog("Max");
d.WagTail();
Cat c = new Cat("Fluffy");
c.Purr();

// JavaScript Dog class
function Dog(name)
{
Pet.call(this, name);
}
Dog.prototype = new Pet();
Dog.prototype.wagTail = function()
{ // Wagging
}
// JavaScript Cat class
function Cat(name)
{
Pet.call(this, name);
}
Cat.prototype = new Pet();
Cat.prototype.purr = function()
{ // Purring
}
consume javascript code
var d = new Dog("Max");
d.wagTail();
var c = new Cat("Fluffy");
c.purr();

call() is a built-in JavaScript function that is used to invoke a specific target function in the context of a specific object. In this case, we are invoking the Pet constructor function in the context of the Cat or Dog instance. In other words, when Pet() is called, the implicit JavaScript variable will refer to the instance of Cat or Dog that is being constructed.

  • Polymorphism

Polymorphism refers to the ability of a caller to invoke a particular method or set of methods on an object without regard to the object's type. For example, we might want to add a speak() method to our Pet class, to allow our Pets to answer the phone when we are not at home; the caller on the other end of the line will not necessarily know or care which Pet is answering the phone, as long as it is able to speak():

// C# Pet class
public class Pet
{
// ...
public virtual void Speak()
{
System.Console.WriteLine(GetName() + " says...");
}
}
// C# Dog class
public class Dog : Pet
{ // ...
public override void Speak()
{
base.Speak();
System.Console.WriteLine("woof");
}
}
// C# Cat class
public class Cat : Pet
{
// ...
public override void Speak()
{
base.Speak();
System.Console.WriteLine("meow");
}

}

Consume C# code
p = new Dog("Max");
p.Speak();
p = new Cat("Fluffy");
p.Speak();

// JavaScript Pet class
// ...

Pet.prototype.speak = function()
{
alert(this.getName() + " says...");
}


// JavaScript Dog class
// ...

Dog.prototype.speak = function()
{
Pet.prototype.speak.call(this);
alert("woof");}
// JavaScript Cat class
// ...
Cat.prototype.speak = function()
{
Pet.prototype.speak.call(this);
alert("meow");
}
Note that the same call() function used to invoke the base class constructor functions is also used to invoke method on the base class.

consume javascript code
p = new Dog("Max");
p.speak();
p = new Cat("Fluffy");
p.speak();