I have this in java:
public interface SomeInterface {
public void doSomething();
}
public class ParentClass {
}
public class ChildClass extends ParentClass implements SomeInterface {
public void doSomething() { }
}
Is this possible on objective c? How to do it on objective-c?
...
I have created this method which is an object factory:
public static T GetService<T>(T serviceInterface)
{
if (serviceInterface.Equals(typeof(IMemberService)))
{
return (T)(object)new MemberService();
}
else if (serviceInterface.Equals(typeof(ILookupService)))
{
return (T)(object)new LookupService();
...
I'm using interfaces in this case mostly as a handle to an immutable instance of an object. The problem is that nested interfaces in C# are not allowed. Here is the code:
public interface ICountry
{
ICountryInfo Info { get; }
// Nested interface results in error message:
// Error 13 'ICountryInfo': interfaces cannot dec...
I am trying to learn OOP in PHP, and I have some confusion about interfaces and abstract classes. They both contain no implementations, only definitions, and should be implemented through their sub-classes. What part of abstract classes clearly distinguishes them from interfaces? Also, due to their apparent similarities, based on what re...
hi,
considering i have a method which gets a List passed as an param. Within this method i want to use for instance an ArrayList specific function on that list (lets say trimToSize()). What would be the general approach to deal with a problem like this ?
Here two example:
First approach (i don't think this is good)
private void doSome...
Marker interface means interface which have no methods. Then why we call the Runnable interface as a marker interface, even though it has run() method.
And one more thing how many marker interfaces are there in java ?
...
HI
I have a question If interface has got four methods,and I like to implement only two methods, how this could be achieved?
Can any explain is that possible or should I go for implementing all the methods.
...
What is best practise with regard to the placement of Interface types.
Often the quickest and easiest thing to do is place the interface in the same project as the concrete instances of it - however, if I understand things correctly this means that you are more likely to end-up with project dependency issues. Is this a fair assessment o...
So that count($object) will return the number of records in it
...
Please explain with a tiny demo
...
I was reviewing the code for KIGG and noticed that there are so many Interfaces. I am fairly new to MVC and do understand what an interface is, a bit.
How does Interface work in MVC, why is it used?
...
I have something like this going on in my Java program:
void f(Object o) {
g(o);
}
<T extends MySuperClass & MyInterface> void g(T x) {
...;
}
How can I cast o so that this works? There seems to be no way to specify both a base class and an interface in variable declarations without using generics. I don't think generics will...
Hi there!
I read (twice) this very useful article: http://blogs.adobe.com/flexdoc/pdfs/modular.pdf
And, I know that the best way to make a connection from my main app to my modules is through interfaces.
So, my problem is, how can I implement an interface so my module can send and receive data from my main app?, cuz, I understand that...
I'm parsing a http GET query string into its components. In trying to make it modular (the number and types of parameters can vary quite a bit), I want to have a Parameter abstract base class or interface that defines whether a property has been set or not, along with a Set method that sets the value. Is there a way to do that with a var...
I'm programming an iPhone app and I'm wondering how programmers properly position controls without using Interface Builder. More or less, this is because I want to position a couple of controls without using Interface Builder.
Thanks!
...
Hi,
I have created a custom view with Interface Builder and defined its IBOutlet variable within my ViewController.
Now I would like to instantiate multiple variables of this view, without duplicating the view in Interface Builder and creating its respective IBOutlets.
When I connect the view in Interface Builder to multiple reference...
When do you encourage programming against an interface and not directly to a concrete class?
A guideline that I follow is to create abstractions whenever code requires to cross a logical/physical boundary, most especially when infrastructure-related concerns are involved.
Another checkpoint would be if a dependency will likely change i...
Hi,
My app requires an interface that has many buttons, text fields and matrixes. And they need to change from time to time. Right now I do this by having all elements in IB already and hiding/showing/moving them when needed. What would others recommend? Should I do that? Should I use an NSTabView? NSView? Should create the elements pro...
I know in spring we all code to interface. So the implementation class should not be known to outside world at all. But it is a public class so anyone make an instance of the implementation class also. How do you prevent this? Do you make the constructor private? Since spring creates an instance of through reflection, it should be fine. ...
I saw in a projekt many interfaces which just wrapped a generic class.
An example:
public interface IAssertionViewModelMapper : IMapper<Assertion, AssertionViewModel>
{}
public interface ISearchPageViewModelMapper : IMapper<IList<Tag>, SearchPageViewModel>
{}
Could someone explain why they did this ? I mean I can just straight impl...