We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [interface]

Object interfaces allow you to create code which specifies which methods a class must implement, without having to define how these methods are handled.

Filter by
Sorted by
Tagged with
2
votes
1answer
96 views

Backend interface VS hard contract

Here is an API for using a warehouse: ...
2
votes
1answer
465 views

Implementing an HotelManager interface in Java

Got a mission to implement an Hotel Manager interface. I will post the interface and the attached class Reservation, and will add my code. What I am asking you is ...
2
votes
1answer
212 views

Somewhat less semi-primitive IRC bot - follow-up

As of now, instead of the previous 4 or 5 out of 10 (relative to my C# programming skill), I'd say I'm a solid 6, and some of that is thanks to the advice I got from the last revision. I realize the ...
2
votes
2answers
2k views

DataStream interface for reading and writing data

I am writing a C++ library which will interact on files, memory buffers and remote files accessible with the HTTP protocol. To handle that, I've decided to create some classes that will use the ...
2
votes
1answer
55 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 ...
2
votes
1answer
735 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 ...
2
votes
1answer
764 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 ...
2
votes
1answer
82 views

Interface and inheritance; creating download types for a download manager

I'm creating a download manager in C# (in combination with Unity 2019.1.8, running the .NET 4.x equivalent (MONO) scripting back end). To accomplish this I decided to start using interfaces and class ...
2
votes
1answer
97 views

Handing multiple workflows cleanly in LOB application

Background I'm about to build a LOB application that resembles an e-commerce solution (without paying and being open to the public). It will be used to receive orders for fulfillment purposes based ...
2
votes
1answer
64 views

Persisting data between HttpRequests in MVC

IMetadata ...
2
votes
1answer
968 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 ...
2
votes
1answer
36 views

Rendering elements (which can change numbers) using jQuery

Currently when the user selects some tags in my app I generate them in a function, like this: ...
2
votes
1answer
134 views

Handling related generic type parameters

In answering a question on StackOverflow, it occurred to me that a more generic version of GroupBy for C# that delegated membership in each group to a class could ...
2
votes
1answer
407 views

Implementation of generic unordered list in java

This question is a follow-up question of this question. These features are added to the new class - Generic class User is capable of setting the size ...
2
votes
2answers
86 views

Represent a person who has different roles for different offices

People have different types of roles depending on the office they are working at. For example, a person has two roles (cashier,cleaner) at OfficeMax and five roles(manager,security,etc) at OfficeLess. ...
2
votes
1answer
62 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 ...
2
votes
1answer
188 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 ...
2
votes
1answer
570 views

Ogg audio format conversion classes

This is my command interface: public interface IConverter { void convert(); } This is my Receiver class: ...
2
votes
0answers
61 views

Expression validator service

I'm working on a project (in C++98) that uses a grammar validation service to validate mapping expressions for a small DSL. To simplify the project code, I've written a small interface for using the ...
2
votes
0answers
128 views

Safest Connection pool in Java

I have read the code reviews on this website: this one and this one So creating the pool in itself might not be that difficult, I'm more worried about the client closing the connection or the ...
2
votes
0answers
115 views

Interface modelling for a journaling program in Java

My program's Journal consists of unique Pages identified by their Day. Within those pages ...
2
votes
0answers
85 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 ...
1
vote
2answers
47 views

Cameras and ITrackableObjects

The purpose of these two classes (and hence why I am including them together) is to allow you to create a Camera, that indicates a "render zone", and track an ...
1
vote
2answers
85 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 ...
1
vote
2answers
137 views

Derived methods with Poker classes

I have an interface with two functions. This interface is being inherited by an abstract class which implements just one of those functions. The other one is left to be implemented by the derived ...
1
vote
1answer
216 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. ...
1
vote
1answer
41 views

Proper naming for objects which have a position and bounds on a plane

I have an interface which is for an object which has bounds in a 2D plane. ...
1
vote
1answer
909 views

PHP OOP API Class

I want to do an API or contract in Laravel focus when one person wants a contract or credit, but honestly it's for a scholarship but the process it's similar when I got a credit from a bank. Honestly ...
1
vote
1answer
1k views

Document (PDF, TXT, DOCX) to text classes

I wrote some classes to convert some documents (PDF, DOC, DOCX and TXT) to only text so that it can be stored in a search engine. Here's how I use those classes : ...
1
vote
2answers
161 views

Delphi 2009 interface

I have this code and at the end of it, FastMM shows that there were memory leaks with all the objects of TSinc: ...
1
vote
1answer
63 views

Interfaces & Factory for generic container supporting PeekMax, PeekMin, Sum, and PeekNextToMax

This is a partial update of this question. An implementation of these interfaces is in this question. To summarize, the class is a generic container similar to MaxHeap, but only needs to support the ...
1
vote
1answer
6k 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 ...
1
vote
2answers
80 views

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 ...
1
vote
1answer
7k views

Common interface with different return types [closed]

I am creating a small app working on file system. The user can choose a directory and than, application get one of the possible result (examples): return number of lines in all *.java files return ...
1
vote
1answer
671 views

ChangeCalculator for calculating money denominations in change

I'm doing some exercises in OOP and I just created a program that calculates amounts of denominations in a change at the shop. So, let's say something costs 10, I give 25.30 (for some reason), so I ...
1
vote
1answer
887 views

Templatized Object Pool in C++

I'm following Robert Nystroms example to try and implement a decent object pool for my next couple of C++ based games. My version is templatized to allow arbitrary classes to be pooled. I'm asking ...
1
vote
1answer
25 views

Multiple Interfaces modifying contract

I have a problem with my interface-design. I especially ask for help with the overloaded compute-Method. For a calculator I work with these Interfaces: ...
1
vote
1answer
67 views

Trying to implement cross-class functionality that needs a field to operate in C#

Crosspost from here, it was suggested that this is better place to pose my question. I'm implementing a series of classes in a game that all derive from one base class that references the scripting ...
1
vote
1answer
78 views

Interface for fixed-size container supporting max, min, sum

I had posted this previously as part of Generic container similar supporting PeekMax, PeekMin, Sum, and PeekNextToMax but I think it was to big a morsel for people to chew on. So I'm splitting it up. ...
1
vote
1answer
1k views

Initializing local variable to generic interface

Below is my working code written as an exercise in wildcards in generics and Java 8 type inference. My question will be about the commented line in union() method. ...
1
vote
1answer
54 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
7k 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 ...
1
vote
1answer
2k views

Can someone review my doubly linked list?

Here is the implementation with the interface below: ...
1
vote
1answer
6k 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. ...
1
vote
0answers
75 views

Simple Serial Port Windows Interface

I implemented a very simple blocking uart interface. Most of the serial instruments I interface with are master/slave and I have to wait on data to proceed forward. I am contemplating add some ...
1
vote
2answers
2k views

Creating a Student class for a project

To recover from yesterday's disaster, I re-read the SOLID principles and refactored my code. Hopefully I did a better job than yesterday. I wanted to keep my Student...
1
vote
0answers
312 views

MongoDB database abstraction

Backstory The company I work, we have the code below that acts as an abstraction of our database layer, which is mongoDB. This ensures our other code is not too dependent on the database. This is ...
1
vote
1answer
54 views

Passing some redundant parameters to an interface vs creating a new request object every time for the interface

I am writing a proxy class, that will fetch a certain property (say propertyA) by calling an underlying service. Currently we use Service A to get propertyA, but there is a chance that in the near ...
1
vote
0answers
333 views

Base Class Interface for Parent/Child tree hierarchy

I have a class named Object, which is a common interface for all its derived class. The following rules apply to all Object instances. As zero or one parent. As zero or more child. Can not be the ...
1
vote
0answers
25 views

Factory module to convert DOM / ORM data structures

The following code is part of a real estate data processing API. It is being invoked by several modules of a software that translates real estate data in-between different formats (ORM models, DOMs, ...