Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
1
vote
0answers
81 views
Interfaces and Classes between Projects
My application's structure looks like this:
Solution: MySolution
Projects in MySolution: Host, Business, Server.
References between the projects looks like this:
Host <-- Business --> Server
...
1
vote
1answer
48 views
How to deal with interface inheritance and common properties? [closed]
I'm trying to design a generic caching system that takes keyed items and allows either read-only or read-write access to a cached version of it. The read-only backing interface is:
public interface ...
1
vote
1answer
96 views
Can someone review my doubly linked list?
Here is the implementation with the interface below:
public class DoublyLinkedList<E> implements ListInterface<E>, ListIteratorInterface<E> {
private ...
1
vote
1answer
57 views
Call all methods in the interface [closed]
I have an interface and I need to call all methods in this interface:
My interface design:
public interface ICar
{
MoveLeft();
MoveRight();
MoveLeftRight();
}
This code is injured the SRP ...
1
vote
1answer
65 views
Empty abstract class enforce structure
I've been looking into empty abstract classes and from what I have read, they are generally bad practice. I intend to use them as the foundation for a small search application that I am writing. I ...
0
votes
2answers
45 views
the right way to write javascript client's method for channel subscribing
I am writing an open-source application for real-time messaging in web. In my application clients from browser can subscribe on channels. But every channel belongs to a certain namespace which ...
2
votes
1answer
68 views
Common interface but need to have different return types
I was suggested to move my question from Stack Overflow to here. I didn't know about CodeReview, so because it's my first post I would like to say "Hello".
So now, let's come to the issue...
I am ...
2
votes
2answers
308 views
Interface programming with Data Access Layer
I have several controls that are bound from database tables. Putting my OOP thinking cap on I figured since all of the controls will have a SqlCommand name and an associated SqlDataReader object I ...
1
vote
1answer
75 views
Proper implementation of generic repository
What can be done better in this code? I am sure it's not missing much.
You can copy and paste the whole thing in LinqPad; it's all there.
public interface IRep<T>
{
List<T> ...
0
votes
1answer
84 views
Defining a Constructor In an Interface Java? [closed]
I have multiple different implementations of an object, which implement this custom interface I made called Board.
Board contains a method that looks like the following
public void ...
-1
votes
1answer
182 views
Log4Net Wrapper with some error potential [closed]
Some time ago, I found the following log4net wrapper here
But I think it is errorprone (in case of threading, could there be deadlocks?)
and the public interface seems to be too wide.
What to do ...
3
votes
1answer
92 views
Review of 2d Vector class
I'll keep this short. I've never actually done professional C++. I don't really know any of the 'best practices'. I'd like to get some review on a simple class that I've made.
My Vector2d.h file:
...
1
vote
0answers
246 views
Generic Task Blocking Queue
A generic blocking queue has the following properties:
It is thread-safe.
It allows queuing and de-queuing of items of a certain type (T).
If a de-queue operation is performed and the ...
0
votes
2answers
354 views
Singleton interface in Java
I've created a singleton by means of an interface. I don't want to make a thing with getInstance() etc because I don't care about inheritance, and it's redundant and non-declarative.
Are there ...
7
votes
1answer
313 views
Interface using for decoupling
I am studying about how to use interface for decoupling. As I studied I wrote a program. I am pasting my code below. Does my program actually implemented decoupling ?. Is there any modification to ...
1
vote
4answers
153 views
Understanding Interface
//program.cs
class Program
{
static void Main(string[] args)
{
Dog oDog = new Dog();
Console.WriteLine(oDog.Cry());
Cat oCat = new Cat();
...
2
votes
0answers
88 views
jQuery plugin boilerplate jquib - critics please
Inspired by jqueryboilerplate.com I extended their boilerplate to fit my needs. Comming from the PHP development I wanted to have good starting point for writing jQuery plugins with a defined ...
4
votes
3answers
311 views
Is this interface too “god-like?”
I have an MVC framework I've written. I'm trying to abstract out ASP.Net specific bits as well as make it more testable. Previously, I relied on HttpContext.Current in many places, which proves to be ...
3
votes
3answers
111 views
Test Driving Interface Design
I have been doing TDD since I have started my first job out of university (about 5 months ago), most of which is working with legacy code. I started a personal project today and thought I would TDD ...
2
votes
1answer
171 views
Have I implemented the command pattern correctly?
This is my command interface
public interface IConverter {
void convert();
}
This is my Receiver class
public class Ogg extends Audio{
private File src;
private File trgt;
...
1
vote
2answers
351 views
What design pattern to use on this case
I have this code that converts audio to different file formats.
import java.io.File;
import it.sauronsoftware.jave.AudioAttributes;
import it.sauronsoftware.jave.Encoder;
import ...