Skip to main content

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.

4 votes
2 answers
172 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,...
Abdul Ahmad's user avatar
2 votes
1 answer
89 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 ...
saxbophone's user avatar
1 vote
1 answer
97 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, ...
David Moore's user avatar
4 votes
0 answers
96 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 ...
Patrick Christie's user avatar
4 votes
0 answers
115 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 ...
Patrick Christie's user avatar
1 vote
0 answers
84 views

Hashing service for files or directories on a generic filesystem [closed]

my program requires a hash to be generated for files and folders for data integrity between transfers and file system events (if hash is different, file is not ready). For data integrity, I wish to ...
Patrick Christie's user avatar
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 ...
user2190492's user avatar
1 vote
1 answer
101 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: ...
user253872's user avatar
1 vote
0 answers
135 views

.NET Repository Pattern

I'm currently in the process of defining some framework, one of the first things that I thought I could start with was defining some repository pattern/layer. I generally wanted some input on it, ...
JO3-W3B-D3V's user avatar
-1 votes
1 answer
61 views

implementing abstract classes vs interfaces [closed]

I am new to using interfaces and abstract classes. The team I am working with came up with an implementation of what they call a base class that will be implemented by all view model classes. This is ...
user1181226's user avatar
3 votes
1 answer
161 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 &...
Roman Susi's user avatar
-1 votes
2 answers
182 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 ...
tuskiomi's user avatar
  • 185
2 votes
2 answers
85 views

Registering listeners according to SOLID pricipals

I'm practicing oop concepts these days. To figure it out I tried the below problem. There is a sensor monitoring system. It is a simple system that prints a value, ...
Neminda Prabhashwara's user avatar
2 votes
1 answer
38 views

Typescript : Adding types to a function that takes in a string and returns a different promise based on the string

I have a function that takes in a string and based on the string hits different APIs to fetch images. I have solved it by writing an interface and then as the return type of the function, it returns a ...
rakshith's user avatar
5 votes
2 answers
474 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 ...
Pankaj's user avatar
  • 151

15 30 50 per page
1
2 3 4 5
13