interface

Cocoa move to parent from a subclassed instance

I have a subclassed NSTextField to limit the maximum length (only 1 character). Now, once the user finishes entering this one character I would like to move the focus to the next NSSTextView. This is where I need some help. How can I tell the application "move the focus to the next field"? I suppose I need to call the parent view from th...

problem in getting value of the object attribute in flex

i have an xml which contains 'interface' sub tag, iam converting xml to object using SampleXmlDecoder. compiler did not allow me to access the value of the 'inteface' attrible of the resultobject. var xml:XML = event.result as XML; var xmlDoc : XMLDocument = new XMLDocument(xml.toString()); var decoder : SimpleXMLDecoder = new SimpleXM...

VIM Modality interface implementation

I've been searching on google and here on SO for any hints or tips and tricks on implementing the vim like modality interface (the command and insert modes) and possible [demo] commands or keystrokes. Are there any libraries out there for this? ...

Where should interfaces and other dependencies go in C#?

By other dependencies I mean abstract classes, and anything else. I have a project in the form of a dll which needs a certain interface, IInput. A test project requires this interface as well, so I placed this interface in my main project, which in turn is a separate exe assembly. This is because eventually the main project will need t...

How should I inherit IDisposable?

Class names have been changed to protect the innocent. If I have an interface named ISomeInterface. I also have classes that inherit the interface, FirstClass and SecondClass. FirstClass uses resources that must be disposed. SecondClass does not. So the question is, where should I inherit from IDisposable? Both of the following opt...

Java: Simple issue with Interfaces and Generics

I made an interface to work with JGraphT. My intended use is like Comparable, in that implementing Comparable allows objects to be used with certain data structures. Simiarly, I have a JGraphT function that I want to work with anything that is Distanceable. public interface Distanceable<E> { /** * A representation of the dista...

Hands-free mice for programmers?

The standard setup for programmers really requires three hands: two for the keyboard, and one for the mouse. I'm not blessed with an extra hand, so my hands have to shift from mouse to keyboard to mouse. But plenty of hands-free mice exist: either by moving your head, by speaking, or by using feet. I'm not particularly handicapped, ...

How to add a rounded rectangle shape (or Box) in iphone interface?

I want to add a rounded rectangle shape in iphone interface but the iphone library doesn't have that object. How do i do it? ...

Class implementations in interface dll?

Hello, my problem: Inside an application, all interfaces are declared inside an own dll(project "interfaces", for example). Inside project interfaces, there are many class implementations, too. Now I need one of this implemented classes inside another project and get a ring dependency because this project is also a reference in projec...

How not to implement a function of an interface in class?

An interviewer asked me the following question in interview, but I don't know what could be the answer of this question, please help!!! What must be done if i don't want to implement a function in my class that is declared in an interface which is implemented by my class. Edited: I am using .NET with C#. It will be great if a...

How can I store different objects in a single list

I have two classes an Arc class and a Line class public class Arc { protected double startx; protected double starty; protected double endx; protected double endy; protected double radius; public Arc(){} } public class Line { protected double startx; protected double starty; protected double...

What exactly is "interface based programming"?

Hey guys, I often hear/read about interfaced based programming but I am not exactly clear on what that really means. Is interfaced based programming an actual stand alone topic that actually has books written about it? If so, can anyone recommend any good ones? I came across interface based programming as I was reading about how good...

Variables in Interface

Why is that a variable used in an Interface is PUBLIC STATIC FINAL? Why "static" in particular? ...

List of Interfaces vs. List of Derived Type - Cannot Convert Expression Type to Return Type

Why does this work: public IList<ICoupon> GetCouponsForSite(string siteSlug) { var coupons = _db.Coupons.Where(x => x.Site.slug == siteSlug) .Select(x => new Coupon(x.id)); var list = new List<ICoupon>(); foreach (var coupon in coupons) { list.Add(coupon); } return list; } But thi...

Fulfilling a new() constraint on a generic method when using System.Object

I'm working with two third-party libraries, and racking my brain over a way to solve this particular issue. I'm implementing an interface which will pass me objects of type "object", and in a good number of the calls, I need to pass them into a generic method that expects a type with class and new() constraints defined. I know that any ...

Properly extending a COM interface (IDL)

I am working with some legacy c++ code and I need to extend an interface. The current interfaces are for example: [ object, uuid(guid), version(1.0), dual, nonextensible, oleautomation ] interface IInfo : ITask { // Methods here } [ object, uuid(guid), version(1.0), dual, nonextensible, oleautomation ] interf...

Make sure only corresponding implementations or childs of it will be handled

Imagine the following situation: As may notice the Handler-childs and the Costumer-childs match each other. Each Handler has a method that takes a costumer. Is there any good way true oo-ish to make sure that a Handler-implementation only takes a correponding Costumer-implementation or any childs of it? Some examples: Handler will...

Is it ok to use interfaces solely for testing?

Suppose ConcreteService is the only non-testing implementation I'll need. Is it ok to extract an interface (or make its methods/properties virtual) solely for the purpose of being able to test objects dependent on it? Else I'll have to new up the dependency line, up until it branches (at which point I can inject mocks) every time I wan...

Access control for a services (design decision)

Hi, Let's say we have an interface 'IA' for which we have an implementation 'A'. In our application domain, object 'A' never exists without a container object 'X'. So 'A' is never directly operated upon. 'A' aggregates in 'X'. We don't want to expose 'A' to the outside world. For this we have taken the approach, not to have the public ...

plugin architecture and shared interfaces problem

Hi people! I'm working with a C# plugin architecture. Plugins are DLL's which expose a bunch of presenters, which are objects that implement the IPresenter interface. The IPresenter interface is available in a DLL shared by all plugins. Presenters can also implement additional methods as defined by IAction interfaces, like ILoadAction,...