interface

Why are variables declared with their interface name in Java?

This is a real beginner question (I'm still learning the Java basics). I can (sort of) understand why methods would return a List<String> rather than an ArrayList<String>, or why they would accept a List parameter rather than an ArrayList. If it makes no difference to the method (i.e., if no special methods from ArrayList are required),...

What event/interface is used to show the IWebBrowser2 secure warning?

I am using a IWebBrowser2 control in my application and writing my own container (in C++ - No ATL/MFC allowed). The control works fine. However web sites will not show if I am going from secure to non secure. It trails back to the setting in advanced options of IE (WarnonZoneCrossing) : Warn if changing between secure and not secure. ...

UIButton Background Images appear lighter in Simulator than in IB

Just put a background image on a button. The looks fine in IB but when I build and run the project in Simulator the bg is noticeably lighter. Anyone know why could be? Thanks! ...

Recursive mocking with Rhino-Mocks

Hi I'm trying to unittest several MVP implementations and can't quite figure out the best way to mock the view. I'll try to boil it down. The view IView consists e.g. of a property of type IControl. interface IView { IControl Control1 { get; } IControl Control2 { get; } } interface IControl { bool Enabled { get; set; } ...

Interface Segregation in Qt

I always try to apply the S.O.L.I.D principles and I really like the Qt toolkit but I find myself stuggeling all the time with the single inheritance rule. If you are using multiple inheritance, moc assumes that the first inherited class is a subclass of QObject. Also, be sure that only the first inherited class is a QObject. ...

In Java, when should I use an abstract method in an interface?

I have the following interface in Java public interface IFoo { public abstract void foo(); public void bar(); } What is the difference between foo() and bar()? When should I use abstract? Both seem to accomplish what I want unless I'm missing something subtle? Update Duplicate of Why would one declare a Java interface method...

Database Structure to store multiple inheritance classes

I have two distinct (no inheritance) interfaces: IInvestable and IPricable and two classes: IndexClass and FundClass that are stored in seperate tables in my DB. IndexClass is IPriceable FundClass is IPriceable and IInvestable. I need a table to store prices against an IndexClass and a FundClass I need a table to store that FundClass...

How to add SOAP headers in Silverlight?

Hello all... I'm trying to secure a data service used by my Silverlight, and am looking at using a custom SOAP header obfuscated into the SL and HTTPSed. I've found any number of examples showing how to do this using IClientMessageInspector, IEndpointBehavior, and a few other things. Okay... it all looks straightforward enough. My pr...

How to pass an Interface object to a WebMethod?

I have a .Net web service with web method which take a Interface object as parameter, whenever I try to access the method I get exception saying : Cannot serialize member Product IProduct because it is an interface. Any suggestions to solve the problem ?? [WebMethod] Public double CalculateTotal(IProduct product, int Quantity) { ret...

How can a singleton class use an interface?

I read at many places that singletons can use interfaces. Some how I am unable to comprehend this. ...

Does an abstract class work with StructureMap like an interface does?

I am a big fan of StructureMap and use it in just about everything I do. I have only ever used it with interfaces though. I was wondering if anyone had any experience using with abstract classes? or...does it not support that type of wiring? If you got this to work can you post an example? Thanks! ...

Flex Newbee pondering workflow and best practice

I'm a seasoned PHP developer and have spent quite a few years building AS2 and timeline Flash projects as well. And, I'm extremely anxious to start working in Flex as well. - I have the perfect project for it too. However, while reviewing the tutorials and example Flex projects, they seem to focus mainly on form elements and data grids, ...

Can I force certain settings by user in SQL Server?

I have a bunch of users making ad-hoc queries into a database running SQL Server. Occasionally someone will run a query that locks up the system for a long period of time as they retrieve 10MM rows. Is it possible to set some options when a specific login connects? e.g.: transaction isolation level max rowcount query timeout If this...

ATL/COM: Defining a COM interface that won't be available outside of the DLL?

I have an ATL/COM-based DLL, made using VC++ 6.0. It's used for various executables built using VB6. I want to add some COM interfaces that will not be accessible via VB6, for the internal use of the DLL only. I want them to be COM interfaces rather than just C++ interfaces due to the fact that I'll be using them on objects which I on...

Is there an HTML5 RIA toolkit available?

I think that HTML5 is the way of the future for the development of Ria application due to the reduction of the ammount of javascript need for basic animation, video, etc. So what are the tools available NOW to develop html5 interfaces? EDIT: It's been a year since this question has been asked. Has the outlook for HTML5 changed for th...

javac complains: cannot find symbol on enum implementing interface

I have three java types as defined below: Main.java: import java.util.Arrays; import java.util.List; public class Main { private Object callFunction() { OperationDefinitions func = OperationDefinitions.CONCATENATE; List<Object> values = Arrays.asList(new Object[] {"ABC", "-", "DEF"}); return func.call (values)...

Probable overuse of java interfaces in my implementation of Ms. Pac-Man

I have been a Java programmer for the last 6 years, and since the beginning of this year I got interested in game programming. So, I thought it was a good idea to start with a popular game and I implemented the game Ms. Pac-Man in Java. I can say that my implementation looks about 90% similar to the original game, and I tried to used as ...

How to use java interfaces with multiple implementing classes.

public interface Foo { } public class SpecificFoo implements Foo { } public interface SomeInterface { void thisMethod(Foo someKindOfFoo); } public class SomeClass implements SomeInterface { public void thisMethod(Foo someKindOfFoo) { // calling code goes into this function System.out.println("Dont go here please"); } public...

Code using classes and interfaces

I'm new to Java, but I understand the basics. I know that interfaces are abstract classes and they're used for emulating multiple inheritance (kind of - I know that in Java this is not allowed). I have this code; would you explain it to me? Here is part of a method that iterates over a list of classes: Constructor[] c = aClass.getConst...

How to get the last key pressed without stopping the C programm ?

Writing an application with command line interface and I would like to know at any time if F1 or esc or an arrow key is pressed. What is the simplest way of doing this. I would like to avoid using readline type library. Edited: Linux specific question. It is not multithreaded ...