SVN and CVS are two very different systems that aim to address the same basic issue - source control.
They both work in distinct ways, so it's probably difficult to deal with them exactly the same.
What I'm wondering is, would it be conceivable to develop a programming library or API that exposes the same interface, but under the hood,...
I understand that, if S is a child class of T, then a List<S> is not a child of List<T>. Fine. But interfaces have a different paradigm: if Foo implements IFoo, then why is a List<Foo> not (an example of) a List<IFoo>?
As there can be no actual class IFoo, does this mean that I would always have to cast each element of the list when exp...
How do I setup a class that represents an interface? Is this just an abstract base class?
...
as a follow up on my previous question
Having a function with combined generic bounds such as:
<T extends Foo & Bar> void doStuff(T argument) {
//do stuff wich should only be done if arguments is both foo and bar
}
Because this is not castable from a unspecified object, you need to have knowledge of some object which actually implem...
I'm looking at some open source Java projects to get into Java and notice a lot of them have some sort of 'constants' interface.
For instance, processing.org has an interface called PConstants.java, and most other core classes implement this interface. The interface is riddled with static members. Is there a reason for this approach, or...
I have used extension methods to extend html helpers to make an RSS repeater:
public static string RSSRepeater(this HtmlHelper html, IEnumerable<IRSSable> rss)
{
string result="";
foreach (IRSSable item in rss)
{
result += "<item>" + item.GetRSSItem().InnerXml + "</item>";
}
...
Hello
How do I change the JFileChooser behavior from double-click selection to single-click selection mode?
I'm developing an application to run with either a single-click interface (nothing requires a double-click, just like the KDE interface mode) or a double-click interface (the default Windows interface mode or the regular GNOME in...
I have a class that inherits a generic dictionary and an inteface
public class MyDictionary: Dictionary<string, IFoo>, IMyDictionary
{
}
the issue is that consumers of this class are looking for the '.Keys' and ".Values" properties of the interface so i added:
/// <summary>
///
/// </summary>
ICollection<string> Keys...
The title basically spells it out. What interfaces have you written that makes you proud and you use a lot. I guess the guys that wrote IEnumerable<T> and not least IQueryable<T> had a good feeling after creating those.
...
I'm using an hierarchical FSM for an embedded C++ application interface. I'd like to use small functions to determine whether certain inter-state events can be triggered, as well as use them to effect changes in the database: however, making a new class with different event functions for each state is daunting, as well as setting pointer...
I'm experimenting with IoC on my way to TDD by fiddling with an existing project. In a nutshell, my question is this: what are the best practices around IoC when public and non-public methods are of interest?
There are two classes:
public abstract class ThisThingBase
{
public virtual void Method1() {}
public virtual void Method...
I understand that programming to interfaces helps with loose coupling. However, is there a guideline that explains when its most effective?
For example, I have a simple web application that collects data on employees, their training plans, expenses and computes their expense for the year etc. This is a fairly simple application and I ca...
Can I do it with reflection or something like that?
...
I've been using moq to mock objects in my unit tests and I've seen on the site about moq that it is able to mock both classes and interfaces.
I had a discussion with one of my work mates the other day and they stated that there is never a reason to mock classes and I should only mock interfaces.
I didn't really have an answer to that.....
Hello,
as I am implementing the ICollection-Interface in my class I want to implement the CopyTo-Method and I have to throw an Argument-exception if the array is multidimensional.
What is meant by this? The head of my method is this
public void CopyTo(MyClass[] array, int arrayIndex)
I thought these brackets would mean that the given...
I have an interface A, for which I have to supply a few different
implementations. However, those implementations share some helper methods, so
I moved those methods to an abstract base class.
Interface A {
void doX();
}
abstract Class B implements A {
protected void commonY() {
// ...
}
@Override
public abstract void doX();
}
...
From what I have read best practice is to have classes based on an interface and loosely couple the objects, in order to help code re-use and unit test.
Is this correct and is it a rule that should always be followed?
The reason I ask is I have recently worked on a system with 100’s of very different objects. A few shared common inter...
I'm still learning ASP.NET and I often see code like this throughout parts of our framework:
Public MustInherit Class DBFileManager(Of F As IDBFile, FC As IDBFileContent, FT As IDBFileThumb)
Can anybody tell me what this means? Much thanks!
...
I have an interface that defines some methods I would like certain classes to implement.
public interface IMyInterface
{
MethodA;
MethodB;
}
Additionally I would like all classes implementing this interface to be serializable. If I change the interface definition to implement ISerializable as below...:
public interface IMyI...
My question is, if an interface that is implemented implicitly by extending a class that already implements it, should be explicitly implemented by the class, if the class wants to advertise the fact, that it fulfills the contract of that interface.
For instance, if you want to write a class, that fulfills the contract of the interface...