The difference between the two might be fuzzy at the edges,
but the basic idea is:
Web application:
Any application which resides on a server, but meant
for use by humans, which uses web pages as the presentation layer. All user
interactivity (the GUI) is done through web pages, but all data is stored and
(mostly) manipulated on the server.
Web service:
Server-based application (as above) which may be accessed
over the web via HTTP, but is meant primarily for interaction with other
programs. Thus, it will have a clearly-defined API which consists of providing
responses to HTTP GET and POST requests made by a remote application. Now, this
doesn't mean you can't access a web service from your browser, but it means
that the application won't necessarily have a GUI user interface. You
will most likely, for example, receive all results of GET and POST requests as
strings of XML, which requires a client-side parser.
So, think of web applications as completed user interfaces, while web services are more intended to be application components or "libraries" which can be used by other applications. Essentially, web services are to distributed applications what DLLs or class libraries are to most traditional compiled applications.
Also, this means that a web service has to have a more organized design that most web applications, because there won't necessarily be a human at the other end who can figure out through trial and error what the app does. This is why the whole concept of "web services" has brought a whole new set of acronyms such as SOAP, UDDI, etc...
So, think of web applications as completed user interfaces, while web services are more intended to be application components or "libraries" which can be used by other applications. Essentially, web services are to distributed applications what DLLs or class libraries are to most traditional compiled applications.
Also, this means that a web service has to have a more organized design that most web applications, because there won't necessarily be a human at the other end who can figure out through trial and error what the app does. This is why the whole concept of "web services" has brought a whole new set of acronyms such as SOAP, UDDI, etc...
OOPS
What are the OOPS concepts?
2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.
3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods", This means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation.What is the difference between a Struct and a Class?
- The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive.
- When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized.
- It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values.
- It is an error to initialize an instance field in a struct.
- There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do.
- A struct is a value type, while a class is a reference type.
Value type & reference types difference? Example from .NET. Integer & struct are value types or reference types in .NET?
- Built-in
value types
The .NET Framework defines built-in value types, such as System.Int32 and System.Boolean, which correspond and are identical to primitive data types used by programming languages. - User-defined
value types
Your language will provide ways to define your own value types, which derive from System.ValueType. If you want to define a type representing a value that is small, such as a complex number (using two floating-point numbers), you might choose to define it as a value type because you can pass the value type efficiently by value. If the type you are defining would be more efficiently passed by reference, you should define it as a class instead.
Variables of reference types, referred to as objects,
store references to the actual data. This following are the reference types:
- class
- interface
- delegate
This following are the built-in reference
types:
- object
- string
- What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?**
What is Method overloading?
What is Method Overriding? How to override a function in C#?
You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override.Can we call a base class method without creating instance?
Its possible by inheriting from that class also.
Its possible from derived classes using base keyword.You have one base class virtual function how will call that function from derived class?
class a
{
public
virtual int m()
{
return
1;
}
}
class b:a
{
public
int j()
{
return
m();
}
}
In which cases you use override and new base?
C# Language features
What are Sealed Classes in C#?
What is Polymorphism? How does VB.NET/C# achieve polymorphism?
{
public
string Display()
{
//Implementation
goes here
return
"base";
}
}
class IdentifierToken:Token
{
public
new string Display() //What is the use of new keyword
{
//Implementation
goes here
return
"derive";
}
}
static void Method(Token t)
{
Console.Write(t.Display());
}
public static void Main()
{
IdentifierToken
Variable=new IdentifierToken();
Method(Variable);
//Which Class Method is called here
Console.ReadLine();
}
For
the above code What is the "new" keyword and Which Class Method is
called here
A: it will call base class Display method
No comments:
Post a Comment