interface

How do I remove implementing types from GWT’s Serialization Policy?

The opposite of this question: http://stackoverflow.com/questions/138099/how-do-i-add-a-type-to-gwts-serialization-policy-whitelist GWT is adding undesired types to the serialization policy and bloating my JS. How do I trim my GWT whitelist by hand? Or should I at all? For example, if I put the interface List on a GWT RPC service class...

Agents in minority games: inheritance hierarchy, pluggable behaviour through interfaces or some pattern?

I'm currently building a library to allow a wide variety of different minority games to be simulated. This involves agents choosing between two choices, say, A and B so the primary functionality of an agent is to choose. An agent wins a point for a turn in the game if it ends up in the minority group after all agents have chosen. There ...

Java: interface / abstract classes / abstract method

Please help :/ In Java you can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces? Cheers! ...

Implementing "add photo" button similar to the iPhone contacts app

I was curious if anybody knew the process to create an "add photo" image tile similar to that in the iPhone contacts app. It seems to be on the same level as a UITableViewCell which is shortened (if this is the way it is done). I've read a suggestion dealing with Headers or custom UITableViewCells but nothing definitive on how it was do...

What are the factors to consider when choosing between interfaces and abstract classes?

When designing my software, I began with interfaces since this seems to be the "standard". Then I switched to abstract classes because they seem better suited to the problem at hand. However I'm not sure if I've missed out on some considerations when making this design choice. Other than domain specific issues which I have thought abo...

sharing interfaces with web services in .net

I am using a web service. I define an interface in the web service. Can I use this interface definition in my project that invokes the web service? I know I can use classes defined in the web service. Do I have to do anything special with the interface like add an attribute? ...

Why declare an interface as abstract?

What's point of declaring an interface as abstract? Same thing for an interface method. Is there a point to it? eg. public abstract interface Presenter { public abstract void go(final HasWidgets container); } ...

Attribute, interface, or abstract class

I'm wondering what the general recommendation would be (attribute, interface, abstract class, or combination thereof) for the following implementation: /// <summary> /// Loads class specific information into a list for serialization. The class must extend PlugIn. /// The filenames parameter is passed from a FileDialog. /...

Java Interface Question

I have to work with an API that is accompanied by a few examples. In one of the example, an interface is being directly used to call one of the methods of that interface. However, since Interface do not contain any implementation, I would like to know: How can the methods be used in the example to accomplish anything without defining a c...

COM - How to create a method that returns a pointer to an interface?

How to create a method in COM that returns a pointer to an interface, this needs to be done inside the IDL file. EDIT: How do I implement this within a class: STDMETHODIMP CBlah::get_Something(IOtherBlah** retval){ return m_protectedvar->QueryInterface(retval); } STDMETHODIMP CBlah::put_Somthing(IOtherBlah* rhs){ m_protectedvar = rhs;...

how do you specify which concrete class is consumed by WCF service

My endpoints specify which interface is used to govern the WCF service. Because it's an interface, I can have multiple different concrete classes implement the interface's functionality. How do I specify which concrete class should be used for a given WCF service's endpoint? How do you say for this endpoint, use this concrete class ...

deployment systems with web-interface other than capistrano?

Hi. I'm running production server with 12 projects written in PHP and Python (Django framework). The problem is that every time i commit something to svn i have to ssh to server and do svn update manually. I've made a simple shell script for this, but it's definitenly not an option. I thought about capistrano+webistrano, but for this i'...

C#: Simulate inheritance using just an interface and an instance of its implementation - is it possible?

I want to simulate derivation from a base class (which is unaccessible) using just an interface and an instance of the base class (as opposed to just deriving directly from the base class). Let me try to explain better: I have an exposed interface and a (hidden) class implementation for it. In another module, I create a 2nd implementat...

Can an Interface contain an ENum?

Can an Interface contain an Enum? I am using asp.net 2.0. Suddenly my code started having problems when I added an enum to the interface below. In it, LookUpType is an enum. Public Interface ILookup Property ID() As Int32 Property Text() As String Property Description() As String Property Status() As Status Property...

C# property not available in derived class

I'm not sure what's going on. I have the following base class: public class MyRow : IStringIndexable, System.Collections.IEnumerable, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IDictionary<string, string> { ICollection<string> IDictionary<string, string>.Keys { } } And then I...

Share interface classes using the same classloader on J2EE/Weblogic 10, without using the system classpath

Hi, I have a "framework" running on a Weblogic 10.0 (or 10.3) appserver, where the framework consists of multiple enterprise apps, each responsible for a different resource adapter. A client application gets deployed into the domain, uses JNDI to obtain reference to one of the resource adapter Connector classes, does its invocations and...

Code Contracts: Is it possible to supply a contract class for a generic interface?

I have just got started using Microsoft's Code Contracts and already ran into a problem that I can't solve. Let's take this interface for which I'd like to specify a contract: public interface IRandomWriteAccessible<T> { T this[uint index] { set; } uint Length { get; } } The documentation says to use the ContractClass attribu...

Get Class level instance of a variable (not Interface)

If I have the following scenario public interface IFace { int NoseSize {get; set;} } public class Face: IFace { private int NoseSize; public int IFace.NoseSize { get { return ClassLevel.NoseSize} set { ClassLevel.NoseSize = value} } } How do I really indicate "ClassLevel"? ...

questions about an article introducing C++ interface

I have been reading an article about C++ interfaces (http://accu.org/index.php/journals/233) and I am completely lost at the part where it says all the virtual member functions should be made private (the section titled "Strengthening the Separation"). It just does not make sense to me at all. According to the author, the code is like t...

Passing an Interface collection

Suppose you have the following class: class Car : IPainting { ... } Then a function like this: void AddCars(IEnumerable<Car> collection) Then a code snippet like this: Car bmw = new Car(); Car mercedes = new Car(); IPainting a = (IPainting) bmw; IPainting b = (IPainting) mercedes; IPainting[] paintings = new IPainting[] {a, b};...