Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.
4
votes
1answer
35 views
Metadata Management
Purpose:
I've on occasion required a method for changing a (or a set of) Display names (formats, order, etc.). The problem was I'd have to push to production just to change something as simple as ...
-2
votes
0answers
54 views
Very first implementation of an interface
So, for my application I need a Localizer so the application can be displayed in multiple languages. Now that I have the localizer, I want to be able to se it in my ...
-1
votes
0answers
21 views
implementation interface concept for making a simple calculator in c# [closed]
how to implement interface concept for making a simple calculator in c#.
...
6
votes
1answer
104 views
Abstracted Interface for Settings
I just learned about the beauties and wonders of interfaces. And, I realized how I could fix some code that has been bothering me because of its duplication.
This ...
0
votes
1answer
78 views
Creating a Generic Template Interface/Class and injecting into another object
I would like to create a generic template class for my document processor. Assuming the template has a source file path and a "content", here's what I came up with:
Template
...
2
votes
1answer
32 views
Python object modelling with ABCs
I'm modelling the core entities in a callcenter-related system that deals with Operators and groups ("pools") of them. While I've written some Python before, this is my first time building a larger ...
3
votes
1answer
68 views
Representing Objects as strings in VBA
I am working an a more meaningful way to print objects in VBA. The desired result should look something like this.
...
1
vote
1answer
37 views
Managing a collection of object instances and getting them back out with instance manager / service locator
I'm creating an event loop for an asynchronous event execution library for PHP in PHP. Note that this is for a library and not an application. My event loop is just that -- a simple event loop that ...
1
vote
1answer
142 views
IRepository Pattern - Interface Segregation Principle
I have an IRepository class that I use a lot. But I noticed that for many of my repositories I do not implement most of the methods. Also, I usually don't have a ...
4
votes
1answer
60 views
Do you view this ThrowingFunction interface as “interface abuse”?
I am currently implementing a fun project involving lambdas and this project makes heavy use of the ability of Java 8 to have default methods in interfaces.
But when does such "heavy use" turn into ...
5
votes
2answers
94 views
Is it ok to add a static method to the IEqualityComparer implementation?
Linq methods like Distinct need IEqualityComparer object. But sometimes I just compares two objects and to create Comparer instance for that is seems redundant. So it would be nice to use static ...
5
votes
1answer
227 views
Drying Up Very Similar Implementations of an Interface
Work continues on the Rubberduck VBA Editor Add-in. I have a need to call some VBA code from the add-in with Application.Run. Unfortunately, the ...
0
votes
2answers
60 views
Would you utilise “Using” on a member which is going to be added to a list? [closed]
I have an interface and a concrete class which I am using in the code below:
...
10
votes
1answer
209 views
Inspector Rubberduck
Our Rubberduck open-source VBE add-in project is coming along nicely. One of the main features we're going to be implementing in the next release, is code inspections.
I started by defining an ...
4
votes
1answer
35 views
Less insane interface design for a trigger component for T types?
Disclaimer: I just asked this on the regular SE, but was suggested to post it in here since it's kind of a code review.
I've recently been playing around with component frameworks, and I'm trying to ...
7
votes
2answers
267 views
Abstract classes and interfaces in a game inventory system
After reading a lot about interfaces, which I'm new to, I've tried implementing it in my inventory system for a game I'm working on. I have managed to create something proof of concept which seems to ...
1
vote
2answers
62 views
Simple interface and class for holding text to be analyzed
I am making a sentiment analysis library targeted first at social media text (like Twitter) and then I will expand it for more general use.
For the first step I am making a simple interface and a ...
2
votes
1answer
44 views
Implement interface type in implementation of another interface without too much casting
I have a group of tests that must be run in similar (but different) fashion and they have setups, results, etc. which are also similar but different. Great, I thought, I'll use interfaces to define ...
3
votes
2answers
149 views
Overly interfaced or not overly interfaced?
I have to take over an old project that was coded in VS 2010 C# 4.0 in 2012. Interface programming seems to be all over the place and over-applied to me, but I am unsure if it is that way.
I need to ...
3
votes
1answer
141 views
Public interface for nearest neighbor data structures
I am making a small library of metric data structures. That is data structures, which associate points in the n-dimensional space with objects and allow the user to find objects which are closest to a ...
0
votes
2answers
190 views
Safe DbContext Disposal
I have a service class called ClientService, the service class is called using an interface IClientService. The service class ...
2
votes
2answers
103 views
Generic data interface
I currently have the following working code. I am looking for some suggestion with best practices and perhaps a better way to accomplish my goal.
Goal: - in short - Have a generic data interface as ...
0
votes
1answer
191 views
Polymorphic template cloning class
I have a requirement of a templated clone() method which Base classes can implement through an ICloneable interface and all the ...
10
votes
2answers
194 views
PDO connection via INI parser classes
A few days ago I asked this question and I've got an answer to work with interfaces. I've tweaked around with this to get myself a INI parser class.
...
0
votes
1answer
233 views
Mapping interface between POJOs and DTOs
Following up on this question DTO interfaces for implementing web service integration I came up with this implementation.
Data Transfer Object interface following a java.util.Map protocol. The ...
2
votes
1answer
76 views
Functional interface uses uncheck or unsafe operations
First of all, I am absolutely surprised that this code even works. Originally what I did was create a version checking system for Minecraft plugins (specifically Bukkit, Craftbukkit, & Spigot).
...
3
votes
1answer
291 views
DTO interfaces for implementing web service integration
I am trying to define some interfaces to implement some web service integration middleware.
The SOA pattern that fits this system is probably the Multi-Channel Endpoint.
I expect a lot of mapping of ...
4
votes
2answers
105 views
Create User profile with separate social media data
I am creating user profile logic for a blogging platform. I have the UserProfile model and then two separate models, ...
4
votes
1answer
60 views
Post Service Class
I have one entity that depends on another however in my API service class I would like to just deal with the dependent entity. Am I doing this correctly and is there a better way to go about this?
...
10
votes
1answer
299 views
Unit Testing in VBA
Unit testing in VBA is... lacking. (What isn't lacking in VBA though?) Since I've become more interested in unit testing lately, I decided I needed something better than ...
2
votes
1answer
139 views
Is my design achieving Separation of Concerns in this MVC implementation?
I've read lots about getters and setters being evil, unless there is good call for one, but I cannot figure out how to implement that knowledge into my Model layer.
Say in my Model layer I have a ...
6
votes
1answer
80 views
UnitOfWork, an excuse for multiple repositories
I needed a way of attaching multiple repositories to a presenter. Given I already had an IRepository abstraction, coming up with an ...
2
votes
0answers
71 views
NodeJS, status propagation to interface
If you have an interface served by a NodeJS API, what is the most clean way to propagate status changes to the interface?
For example, I have a page that has 2 statuses, user logged in and guest. How ...
11
votes
2answers
380 views
Instantiating a run-time implementation of an interface
Below is my code that was written for the following task (based on an SO question):
Given a Java Collection (of N elements) create an ...
11
votes
4answers
252 views
More German overengineering™ - Class mappings and factories
Goals:
So the plan was simple: Provide a factory to instantiate implementations of a certain interface (ModelConverter<T>), depending on what model-class you ...
14
votes
4answers
2k views
Reusability vs simplicity in a small game with a set of interfaces
I have a small game I'm working on with a set of interfaces:
IHavePosition:
...
3
votes
2answers
221 views
Locate user of an Android device
I am new to oriented object paradigm and I work on Android using Java project for an internship.
I must be able to locate the user and some around buildings I read stuff about how to setup ...
3
votes
1answer
67 views
Potentially superfluous iOS interface system
I have written an interface system for iOS that allows interface elements to be moved around on the screen as actors move around on stage. It can operate within a ...
1
vote
0answers
55 views
Is this interface structure/setup correct?
I'm working on wrapping the last.fm web API. I'm trying to use Interfaces to be able to easily make calls via functions which return an interface (as opposed to an object which would need to be ...
4
votes
2answers
153 views
User Authentication Bundle
I wrote a user authentication program(s) for an MVC application. Before you ask part of the project specs are I have to store user information in company databases on servers that aren't the web ...
2
votes
1answer
140 views
Many interfaces and lots of inheritance vs few interfaces and less inheritance? [closed]
I have a Visual Studio Solution which has a bunch of Projects in it. One of these projects is called "Services" and is basically the junction point between all remaining projects. When I built it ...
3
votes
1answer
80 views
Loose coupling, accessing class properties
I'm trying to get a better understanding of decoupling methods. Right now, I have this method:
...
5
votes
2answers
98 views
When should I actually derive from my interface?
Context:
I am working on an XNA project, and since procedural generation is likely to be used, I wanted to eventually create a helper class to work with data to facilitate that.
Design Goal:
...
2
votes
1answer
88 views
Cleaning User Input
I am not sure if I am approaching this task the correct way. I have a view model with multiple string properties. I pass the model through an interface to a service class that contains a void to ...
10
votes
2answers
156 views
Functional interface hierarchy in Java 8
I just created the following code and am wondering whether it is logically correct (all other feedback is of course also welcome):
...
3
votes
1answer
68 views
How to provide best integrity for interfaces in C#?
I am trying to apply Interface principles into my code, learn by practice method.
I have a CRM system that has Notes, Payments, DairyEvents and anything else that needs to be bolt on over time.
I ...
5
votes
1answer
172 views
Interface for a tree node in Qt
I have the following C++ interface (in Qt) for a tree node, inspired somewhat by Valve's implementation of a culling octree:
...
12
votes
1answer
166 views
DataLayer Interfaces Genericized
I have some concerns on my refactoring for the data layer in my current Project. Just for a small info, I am currently building a CRM as "training JEE application". But enough of talk, let's talk ...
5
votes
1answer
90 views
Binary relation interface
I'm trying to design a binary relation interface in Java and then implement it, but I'm not sure if I'm doing it right. I'd really appreciate a little feedback just so I know if I'm way in the wrong ...
6
votes
2answers
2k views
Empty Interface usage - is this a code smell?
I've recently made a set of interfaces/classes to work with converting a spreadsheet into an object but I utilise an empty interface in my design:
So first off I have my interface which defines what ...