Questions tagged [object-oriented]

Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

302 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12
votes
0answers
78 views

Ruby chess engine gem

This is my first Ruby gem that claims to provide all the rules of the chess game. My goal was to keep this library as simple as possible via OOP principles, and I'd be glad to hear any feedback from ...
10
votes
0answers
250 views

BattleShip - Ships & Players

I'm making a full-blown OOP Battleship game in VBA (previous post: Battleship Grid), and I want this code to be as good as it gets - and better, if I can. I've refactored a few things, introduced a <...
10
votes
1answer
1k views

Parallelizing some model fitting code using multiprocessing

I'm trying to refactor some code for fitting parametric models that are defined symbolically using Theano. My goal is for all models to expose a common interface so that, as far as possible, they can ...
8
votes
1answer
274 views

R function for Dynamic Ordinary Least Squares regression

SHORT VERSION: Made a workflow function, want a better output with methods. General Background I have been working on a package for some time to eliminate the tedium of preliminary time series ...
7
votes
0answers
112 views

Free body diagram generator using MVP for VBA

Based on my understanding of Model View Presenter (MVP) I have it generate a diagram. Is this a correct implementation of MVP? What deficiencies are there in my implementation? UI Generated diagram ...
7
votes
0answers
168 views

Web Battleship -The Unofficial Battleship UI

I've written my own UI for Mathieu Guindon's VBA Battleship (Battleship UI: GameSheet) which uses a webpage in a WebBrowser control for the View. Webform: Userform ...
7
votes
0answers
43 views

Perl Script to import flat-file versioned files into git repositories

I wrote a perl script to import local files with "File-Ending-Versioning" (like file.1.12.pm) into a git repository. I tried to use the concept of roles in this script and I am not shure if I applied ...
7
votes
0answers
1k views

Flask view dependency injection

so, first of all, I've been into trying to have a simple dependency container as possible in python and with your help managed to get conceive https://github.com/dareenzo/tinydic, many thanks. Now, I ...
6
votes
0answers
268 views

Battleship MVC Architecture

The entry point is the Macros module, which - for now - includes only a single procedure, at a very high abstraction level - I'm quite happy with this: ...
6
votes
0answers
118 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
6
votes
0answers
262 views

C++ Parsing with chain of responsibility

The task was to create the parser for the string input, that would return the std::vector< int > of parsed numeric results and the type of given input (e.g. numbers, division by zero error, out of ...
6
votes
0answers
62 views

Model for a multi-channel programmable electrical power supply

I am modeling a programmable electrical power supply which has multiple independent channels (or "ports") in a class I'm calling Supply. One of its features is the ...
6
votes
0answers
142 views

Object-oriented WordPress plugin

Note: This plugin is / was never intended to be submitted to repo just for personal use but the questions still apply to general Plugin Development. This plugin listens for ...
5
votes
0answers
36 views

Interfaces and OOP Design for Image Editor software

I'm new to C++ programming, and I'm building an Image Editor software like Lightroom/CameraRaw from scratch. Apart from procedural code (actually seems that all the functions works correctly) my goal ...
5
votes
0answers
87 views

Java objects for a network sniffer program

I'm working on a network sniffer program, whose structure uses 3 main classes: Frame Class - One per monitored frame, holds reference to all the other sub frames Parse Class - Holds the hex value of ...
5
votes
0answers
88 views

Prototype GameManager for game written in Unity

I am self taught, so I'm consistently seeking ways to code better, and more efficiently. If anyone has the time, please advise me on what can be done better with explanations as to why the old method ...
5
votes
0answers
260 views

ATB strategy MVC architecture refactoring

NOTE: this question isn't as long as it appears to be. I added the comments to the code only to answer some possible questions that may appear. I'm making an active time battle strategy. Its ...
5
votes
0answers
401 views

Writing a metaclass to ensure a class is thread-safe

Python allows the creation of classes to be modified via metaclasses. They can perform all sorts of operations that might appear to be magical to languages that do not have the capability. The goal of ...
5
votes
0answers
175 views

Object-Oriented Sorting Algorithms

I would like a review of a library I've recently published. I realize this is a rather large request, but having looked on meta, it seems this is perfectly on-topic. I'll include a few choice samples ...
5
votes
0answers
322 views

Object-oriented fractal tree

I made an object oriented fractal tree in javascript using the p5 library, it consists of three files: Fraternal Tree.js branch.js flower.js Here is the github repo with the source code. All the ...
5
votes
0answers
74 views

Python-style object library for Clojure

Background I am authoring pulley.objective, an Open Source library that provides an object system inspired by Python's object model. I have some features ...
5
votes
0answers
66 views

Node that makes bots jump with weapon thrust

Today I decided to continue working on a UnrealScript (Unreal Engine 1) class that lets bots jump onto ledges by firing weapons beneath themselves. (The only problem is that they don't aim and jump ...
5
votes
0answers
9k views

Simple Router class

I made a simple routing class that I like to get reviews for, mostly because I do not know how to make it SOLID, since I even made this class separate from the HTTP response/request for the sake of ...
5
votes
0answers
674 views

Simulate object.__getattribute__ in Python

I want a Python example that illustrates how object.__getattribute__ resolves instance attribute lookups. I'm looking for feedback about the following code. Is it ...
4
votes
0answers
76 views

Reusable Progress Indicator

As many have done on this site, I decided to create a progress indicator using a modeless Userform. However, my goal was to make said progress indicator as generic/reusable as possible. While doing ...
4
votes
0answers
65 views

Tkinter application to manage school tasks

I'm a beginner in OOP programming and I'm wondering what is the best way to put all the windows and functions of a window application in the code. My biggest questions are: Am I using classes and ...
4
votes
0answers
675 views

Design an object oriented parking lot

I solved this system design interview question. The problem description Design a parking lot Constraints and assumptions What types of vehicles should we support? Motorcycle, ...
4
votes
0answers
59 views

Tracker for object construction, copy, and movement

I made an object tracker for debugging and testing purposes called ccm_counter (construction, copy, move counter). It counts constructor, copy and move calls. It ...
4
votes
0answers
121 views

So what if the “View” in an MVC isn't a Userform, but is the Worksheet?

So I've been following the discussions around VBA as an OOP language and the applicability of various design patterns, such as MVP or MVC. Excellent postings on these topics are extremely informative ...
4
votes
0answers
272 views

Python Class to represent a Pokemon

I have been programming with Python on-and-off for about 2 years now, even now I still find that when I look at other applications I struggle to follow along with their classes/objects. Please help me ...
4
votes
0answers
115 views

Data processing program

I'm working on part of a service for data processing. The main idea of the service is to get the input data, process it and return the processed data to another service. Input and output data format ...
4
votes
0answers
43 views

Class based Kjijii Webscraper

Using PowerShell I have made a class based Kijiji webscraper that records progress in a MariaDB table (for use in another project). I had made this as a module with cmdlets months ago but I wanted to ...
4
votes
0answers
595 views

Object-relational mapper for VBA / MS-Access

This is my attempt to create simple object-relational mappers (ORM) in VBA for DAO and ADODB recordsets to reduce boilerplate code when converting data between recordsets and objects. As far as I've ...
4
votes
0answers
115 views

Simple command user interface for conditional logic

This is a command-line interface wrap for any application involving conditional logic. I have posted the source here on bitbucket. Usage: Myself using as a starting point for a time series ...
4
votes
0answers
124 views

Given a string of letters, output all English words formable using only those letters

As an introduction to Python classes and an exercise in recursion / tree-traversal, I wrote a small script that forms all English words using only the letters in an input string. Useful for things ...
4
votes
0answers
54 views

Mechanism for providing timeout notifications when traffic ceases

I'm trying to build a nicely encapsulated mechanism for providing timeouts that wait for a signalling channel to go quiet for a duration. As a fun study of ...
4
votes
0answers
501 views

Implement OO interfaces in Python

Edit: Whoops! I just remembered there's already an long-lived package for this, zope.interface. I'd like a review all the same. This is a proof-of-concept ...
4
votes
0answers
64 views

sk-learn like model

I am trying to make a simple model that returns the conditional expectation of a target with respect to the value observed for another variable. Basically, given a feature \$F\$, a level of this ...
4
votes
0answers
416 views

PyQt GUI to add and remove dots

Initially I got this code: ...
4
votes
0answers
146 views

2d game enemy entities factories, probably in need of refactoring

So I'm making a 2d shoot'em up game as a way of learning canvas, and larger-scale programming than what I'm accustomed to. I'm a purely front-end web dev, I can't say I'm very experienced in this. ...
4
votes
0answers
77 views

Creating companion classes that are `inherited` onto any sub-classes

The idea for the code I have written came about due to the acts_as_versioned gem which automatically nests a Version class onto ...
4
votes
0answers
71 views

Comparison of sprite movement implementations

I've come up with two ways to do sprite movement with CreateJS, and I'm wondering if one is better than the other as far as performance and maintainability. The player data is saved in a json file ...
4
votes
0answers
352 views

Building Data abstraction and ADT for rectangle using “objects”

For the below given exercise: Exercise 7: Abstracting Rectangles Implement a representation for rectangles in a plane. (Hint: You may want to make use of your procedures from exercise 5). Then,...
4
votes
0answers
9k views

An Object-Oriented Programming pattern for AngularJS models using CoffeeScript classes

Over the past week, we tried to make our AngularJS model layer more powerful and reduce complexity in our controllers and template by using the object-oriented programming pattern and the CoffeeScript ...
3
votes
1answer
22 views

Filtering a list of customers in Java based on three criteria

Let's assume that you need to filter customers based on 3 criteria: name tags assigned to customer customer's location For some reasons you have to do it directly in your program code, without ...
3
votes
0answers
16 views

Automated machine learning training and evaluation in Sagemaker with XGBoost

This code aims to make very easy to train new models in SageMaker and quickly decide whether a new feature should be introduced in our model or not, getting metrics (recall, accuracy and so on) for a ...
3
votes
0answers
30 views

Adapter pattern to support multiple file storage systems

I am just getting in to following design patterns. I have create a class that allows for performing a couple operations on different remote storage systems: drive, dropbox, .etc (I call these ...
3
votes
0answers
57 views

Footwear scraper

I've done this parser to scrape all footwear data, but I don't know if it is good to use OOP in this case. Can you please check this out and give me the strongest feedback? I'm working on improving my ...
3
votes
0answers
48 views

Object Oriented Chess Design In Kotlin

I know there's a similar question to this: See here. And I have taken the points mentioned there into consideration. However, I wanted to learn Kotlin and thought of writing OOP based Chess myself. ...
3
votes
0answers
83 views

Rich data types - boolean object

Context You can probably skim most of this, it's unlikely to be useful for a review and is just for background info. Also download the files I've tried to create a ...