abstract-class

When to use abstract classes and when to use interfaces in C#

Possible Duplicates: Abstract classes vs Interfaces Interface vs Base class Hi, In C# when should we use interfaces and when should we use abstract classes? Please explain with example ...

Consuming an ASP.net web service using JAX-WS, obtaining "The specified type is abstract"

I am trying to create a quick sample Java client for a SOAP web service we have built with ASP.net. The web service message schema makes use of many abstract classes with implementations of those, e.g. DeviceIdentifier (abstract), with SerialNumber and ProductNumber (these are hypothetical examples to illustrate the question) I used w...

A method which can only be invoked when referring to base class? C++

Say I have an abstract class class NecessaryDanger { public: virtual void doSomethingDangerous() =0; } and a class that is derived from this class: class DoesOtherStuff : public NecessaryDanger { //stuff void otherMethod(); void doSomethingDangerous(); } is there a way I can only allow access of doSomethingDange...

php Singleton pattern with Abstract class and Interface

I am developing a framework. And I have confronted with some difficulties. For Database I have created Abstract class, Interface and some Adapters for different SCDB. For example, Mysqli adapter has the constructor, which call the constructor of parent with settings array as parameter. Mysqli class uses the next scheme: class Hybrid_Db_...

what's the difference between abstract and interface in php?

Possible Duplicate: PHP: What is the difference between an interface and abstract class? hi guys.. As far as I understand, a clase implements or extends abstract or interface class has to use the default methods. I know we can use implement keyword to use multiple interfaces, but we only can extend 1 abstract. Can anyone expl...

What is the major difference between abstract class and interface ?

In context of recent trends in interviews i have noticed that this question arises every time. But when one answers the general definition then the interviewer says everyone knows it... tell something different. Further scenarios are asked where which one will be used and be beneficial and why So kindly share any new insight into this t...

Can I create a Generic delete method to delete any subsonic activerecord<T> object?

We have a C# WinForms app with a number of screens that support CRUD operations. We've been trying to create a generic method in the base form class to delete any subsonic ActiveRecord class. This has proved to be a challenge. calling Delete() for a subsonic type involves calling the static method on the abstract base ActiveRecord<T> ...

Java Abstract Class Implementing an Interface with Generics

I am trying to define an abstract class implementing Comparable. When I define the class with following definition: public abstract class MyClass implements Comparable <MyClass> subclasses have to implement compareTo(MyClass object). Instead, I want every subclass to implement compareTo(SubClass object), accepting an object of its own...

Marshall abstract class without its type definition

I try to achive the opposite of here. I have an abstract class, but I do not want the abstract class' type and tag to be outputted. So I need an output, which basically looks like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dokument ausgabe="ausgabe_test.doc" vorlage="vorlage_test.dot"> <marke typ="text" name="test"> ...

Why does VC2008 think this class is abstract?

I'm writing some code to handle video input from some cameras using DirectShow, so I have to implement ISampleGrabberCB. My class that implements the interface compiles okay, but when I try to instantiate it the compiler raises "error C2259: 'SampleGrabberCB' : cannot instantiate abstract class". Here is the interface I'm implementing:...

Abstract property inheritance and Fluent NHibernate Automapping

I thought I understood what I was doing, and I swear this used to work when I used it in my last project! I have an abstract class Enity that I use as a base class for all my DomainModel classes when working with NHibernate. The class is defined as: public abstract class Entity<TKey> where TKey : IComparable { public abstract TK...

How to test a method in an abstract class with abstract methods?

It is necessary to check implementation of 'MyMethod' virtual method in the abstract 'MyAbstractClass': public abstract MyAbstractClass { public void MyMethod() { Testpassed = true; } public abstract int StatusCode{get;internal set;} // **EDIT**: internal setter was added public bool TestPassed{get;private ...

How can I start a DispatcherTimer when my custom control is loaded?

I need to be able start a timer when my custom control is loaded. However, I need to be able to do this in the abstract class that all controls of this type inherit from. ...

Is it possible to write a extension method for an abstract class.

Why I'm unable to extend an abstract class. Is there any work around to achieve this? In silverlight, Enum.GetNames is missing. So, I would like to extend it and have it in my utility assembly. By then, got into this. ...

Deserializing an abstract class in Gson

I have a tree object in JSON format I'm trying to deserialize with Gson. Each node contains its child nodes as fields of object type Node. Node is an interface, which has several concrete class implementations. During the deserialization process, how can I communicate to Gson which concrete class to implement when deserializing the no...

difference betwenn abstract class and interface

Possible Duplicate: Interface vs Base class Hello all, I am not understanding difference between abstract class and interface, could you tell me please when I need to use which art of type. Thanks a lot and take care, Ragims ...

Contract class should be an abstract class

The following code gives me the warning Contract class 'FooContracts' should be an abstract class. From all the examples I've read online (e.g. http://www.infoq.com/articles/code-contracts-csharp), this should work (presumably without compiler warnings). [ContractClass(typeof(FooContracts))] public interface IFoo { void Bar(string foo...

Abstract Sealed Classes

Just a small question about c++/cli. Abstract classes have abstract methods to be implemented by derived classes, sealed classes dont allow inheritance. So why we have some classes in .NET base class library defined as abstract sealed, and you can find plenty .. ??! ...

Misscreation of my template class causes errors with SOCKET, why?

Hey... I created a class which holds data of type and returns an vector on request. But somehow the following error occurs: error C2259: 'CAcceptor' : cannot instantiate abstract class due to following members: 'void CDataAndEvent<C>::InitQueue(void)' : is abstract with [ C=SOCKET ...

Cloning objects in Java [3 questions]

will the clone method of Asub be called by doing this? Or is Asub deep cloned properly? If not, is there a way to propery deep clone Asub through this kind of method? abstract class Top extends TopMost { protected Object clone() { Object obj = super.clone(); // deep copy and try catch } } abstract class A exte...