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.
192 questions
4
votes
2
answers
276
views
C# items that don't follow rest of interface
I'm working on a game with unity, and I've created a state manager for the in-game state of certain organisms. Each state implements a ISimpleStateManager interface,...
20
votes
5
answers
4k
views
House plan design (Head First C#)
I've been working through the book Head First C# and this is an exercise from chapter 7, which is about interfaces and abstract classes.
Note that the class design was mandated by the authors, I'm ...
6
votes
1
answer
2k
views
Date range generator
An app has a feature that's much like any calendar application (like the Outlook calendar for example).
Consequently, I need to do a lot of date logic. I wrote a class with date calculation methods ...
2
votes
1
answer
122
views
API design for Implementing NaN/Unknown values for custom numeric type
I'm gradually writing an arbitrary-precision arithmetic library for C++. I've decided it could be useful to have the default constructor produce an object of indeterminate value, rather than relying ...
7
votes
4
answers
1k
views
IService<T> or defining IProductService, ICustomerService
As per tutorial here, I have the following classes:
(In reference to this tutorial's section)
...
1
vote
1
answer
141
views
Take meal orders from breakfast, lunch and dinner menus
I have an exercise requires me to write a service to management menu.
The requirement like this:
Food menu includes: breakfast menu, lunch menu, dinner menu. The three menu haves list menu item( name, ...
5
votes
2
answers
523
views
Best approach for the Design Pattern for multiple schedulers using interface and abstract class
I have a requirement to fetch data for different types of Users (Customers, Publishers etc) for three different timelines (retro, current, and past), all have different URLs. There is a scheduler ...
-1
votes
2
answers
225
views
A simple java game engine [closed]
I'm starting an object orientated game engine in Java. My plans for the engine is to be able to split things easily into multi-core loads. My idea is that a Unique (interface with a ...
4
votes
0
answers
147
views
Injectable EventLogger for custom application events that are handled differently from normal logs
I am trying to become better at designing classes for dependency injection and IOC in general. It is often not an intuitive concept.
I have the following python interface and implementation for a ...
8
votes
7
answers
3k
views
An ordered set in C#
I need a generic data structure that ensures that its elements are unique. C# has HashSet<T>, great!
As it turns out, the elements have to stay in the order ...
4
votes
0
answers
120
views
Determine when a file is no longer being changed by hashing
I have a requirement to essentially scan a filesystem on any kind of filesystem and move a resource whenever it is ready. To do this I have the following code
...
18
votes
2
answers
4k
views
Using events together with interfaces in VBA
Introduction
Because of the limitation of VBA in using events in interfaces I was searching for a kind of workaround.
For sure I also read this which also provides an approach, but I was searching for ...
4
votes
1
answer
2k
views
multiple inheritance in c++ to implement different interfaces
I am working on a finite element (FE) code and want to provide multiple material models (20+). In FE applications, the computational domain is subdivided into a set of geometrically simple elements, e....
3
votes
1
answer
219
views
Lightweight interface implementation in Python 3 using abstract classes
Here is my take at a lightweight interface implementation, where I focus on discoverability of suitable classes from strings (for simplicity, class name is used as an id). Each interface has it's own &...
1
vote
1
answer
133
views
Java: Using one class or algebraic data types to model different state?
I'm creating a tool to analyze a card game which is played by three players. A Card is associated with a number of points and looks like this:
...