interface

OOPS query using c#

I have some doubt to implementation of class and interface I have 2 class like this Public Class A:IFinal { private string name=string.Empty; A() { name = "Pankaj"; } public string MyName() { return name; } public string YourName() { ...

Redundancy in OCaml type declaration (ml/mli)

Hello, I'm trying to understand a specific thing about ocaml modules and their compilation: am I forced to redeclare types already declared in a .mli inside the specific .ml implementations? Just to give an example: (* foo.mli *) type foobar = Bool of bool | Float of float | Int of int (* foo.ml *) type baz = foobar option This, ac...

Java: Interfaces containing inner enums; Extending functionality in implementation classes

I have an interface like the following: package example; import java.awt.Point; public interface Thing { public enum MovingState { MOVING_LEFT, MOVING_UP, MOVING_RIGHT, MOVING_DOWN } public void setNewPosition(MovingState state); public Point getPosition(); } and an implementation clas...

need help with classes for multilingual UI

I'm new to OOD so I have a question about the use of classes for creating multilingual UI. I would like to create a class that is available to all forms in my app so i could change UI language whenever I want. The basic idea is in keeping language resources in xml files and creating data bindings for all controls so the Text property is...

problem with wildcards and one class which implements two interfaces

Hi, I have this question. I have class UserImpl implements MyUser, YourUser and class UsersGetterImpl implements MyUsersGetter, YourUsersGetter. I want to implement a method inside UsersGetterImpl, which returns List<MyUser> getUsers() for MyUsersGetterinterface, and List<YourUser> getUsers() for YourUsersGetterinterface, but I cannot...

C#: WCF: Interface inheritance and casting question

I am writing the client side for a WCF service that supports both synchronous and asynchronous calls without having to implement 5-6 different methods in channel for each method in the contract. I have a base interface (IServiceClient) and a generic class based on this interface type (ServiceClient) as follows: public interface IServic...

Creating an interface for an abstract class template in C++

I have the code as below. I have a abstract template class Foo and two subclasses (Foo1 and Foo2) which derive from instantiations of the template. I wish to use pointers in my program that can point to either objects of type Foo1 or Foo2, hence I created an interface IFoo. My problem is I'm not sure how to include functionB in the inte...

jump into interface implementation in Eclipse IDE

You know how in Eclipse, pressing F3 over a method will take you to its declaration? Well I have a method that is part of an interface; clicking F3 over this naturally takes me to the declaring interface. Obviously there is an object implementing this interface and this is where the method is actually implemented. I want, when I press ...

Adding new functions to an interface

Hi, I need to create overloads for functions on an existing interface without affecting any components that currently implement or make use of the interface (ideally). I figure I have a couple of options: Simplified Original interface: public interface IServerComponent { bool Add(int a, int b); } I can add the new overloaded fu...

Implement IDispoable in an Interface

I have a situation where I am defining an interface and then using that directly eg: Dim x as IWhatever = new implementationOfIWhatever() Which is fine, but implementationOfIWhatever also implements IDispoable so I want to be able to do x.Dispose or ideally Using x but get the error that that this is not declared or must implement IDi...

Interfaces vs Public Class Members

I've noticed that some programmers like to make interfaces for just about all their classes. I like interfaces for certain things (such as checking if an object supports a certain behavior and then having an interface for that behavior) but overuse of interfaces can sometimes bloat the code. When I declare methods or properties as public...

Are there reasons to use get/put methods instead of item access?

I find that I have recently been implementing Mapping interfaces on classes which on the surface fit the model (they are essentially just key-value stores with no more meta-data), but underneath they are sometimes quite complex. Here are a couple examples of increasing severity: An object which wraps another mapping converting all obj...

How does .Net CLR implement an "Interface" internally?

Hi All, Just curious about how .NET CLR handles interfaces internally? Q1] What happens when CLR encounters something like : simple interface example. (same used below.) interface ISampleInterface { void SampleMethod(); } class ImplementationClass : ISampleInterface { // Explicit interface member imp...

Image is Clickable, without no hyperlink case surrounded

How to remove the clickabilty of an image? as you may see, there is no arroung the image... the code of img: <input name="ui_taskFormControl$ctl03$ctl00$ctl03$ui_BirthPlaceImage" height="20" id="ui_taskFormControl_ctl03_ctl00_ctl03_ui_BirthPlaceImage" type="image" src="SmartPenHandler.ashx?FormId=XYZ&FieldId=BirthPlace" complete="com...

OO-design for painting program interface

I'm writing a painting program. My basic classes are: class Workspace { Bitmap b; List<Command> undoList; } class Command { void execute(); } class ClearScreen extends Command class BlurEffect extends Command class View { Bitmap screen; } class Interface The workspace object holds the bitmap which represents the progr...

What types of abstract interfaces are most common in practice

I wasn't completely sure how to phrase what I wanted to ask in the title so I'll try to clarify it better in what follows. For C++ software library developers, what abstract interfaces do you find yourselves rewriting often between projects/jobs? For instance, I would imagine that it is fairly common practice for different projects to ...

using silverlight for user interface only

I am planning to make a web application, using silverlight for frontend. requirement is: this frontend will be just an empty shell, and it must be language independent. it will get everything it needs to display and use from server, therefore making it language independent. i tried to find tutorials, but there is nothing. as far as i u...

How to define the default implementation of an interface in c#?

There is some black magic code in c# where you can define the default implementation of an interface. So you can write var instance = new ISomeInterface(); Any pointers? UPDATE 1: Note that is did not ask if this is a good idea. Just how was it possible to do it. UPDATE 2: to anyone seeing the accepted answer. "this should be tre...

Difficulty displaying alert dialog, why does this code force close my app?

I'm very new to Android so I've been working primarily with information from the android developer's page. Everything was going great until I added the code from the alert dialog section. The code they give alone gives me an error when I try to run it on the last line, saying I must initialize dialog, but I feel like I'm getting the Nu...

Is there a World-Wide Stock Market real-time quotes Application Programming Interface (API)?

Hi there, I'm looking for an Application Programming Interface which will allow me to access quotes and other data about multiple company symbols for at least the following stock exchanges: American Stock Exchange (AMEX) Australian Stock Exchange (ASX) Bank of Canada Bombay Stock Exchange (BOM) Canadian Venture Exchange (CVE) Euronex...