Questions tagged [properties]
A property, in some object-oriented programming languages, is a special sort of class member, intermediate between a field (or data member) and a method. Properties are read and written like fields, but property reads and writes are (usually) translated to get and set method calls.
90 questions
2
votes
0
answers
299
views
Simulating Objects with Collections in VBA
Update
I have released a prototype (v0.1.0) of my SOb project, which is a generalized framework for easily simulating objects.
Background
I am writing a VBA module ...
0
votes
1
answer
427
views
Sanitize object to only include specific properties
Object Property Sanitization
I'm learning to code servers using JavaScript, Node, and Express. While writing controllers that create new entries in the database, the need to sanitize the user input ...
2
votes
1
answer
45
views
Pandas-style "indexer proxy" descriptor
The goal is to write a decorator that allows you to define "indexer proxies", which define properties with __getindex__ instead of normal method calls, ...
5
votes
3
answers
2k
views
A method for managing enumerations in VBA
I have for some time been frustrated by the limitations around enumerations in VBA. Googling didn't find anything really simple and comprehensive. So after a bit of head scratching I came up with the ...
3
votes
1
answer
86
views
Coroutine-based two-in-one properties
Over the holidays I played around with coroutines and their use as two-in-one getter and setter methods:
...
5
votes
2
answers
280
views
(de)serializing c++ object almost automagically
Here's one way to solve the serialization problem in c++20, using a json library:
...
6
votes
4
answers
2k
views
Section 2: Classes - Design a StackOverflow Post
Design a class called Post. This class models a StackOverflow post. It should have properties
for title, description and the date/time it was created. We should be able to up-vote or down-vote
a ...
1
vote
1
answer
350
views
Minimal Property system in c++17
So I needed to represent by objects in terms in ini format and change their values from the ini as well, so I thought why don't implement a property system for this. I want it to be bit fast so I ...
8
votes
1
answer
394
views
WPF BindableProperty<TValue> to Reduce Boiler Plate
I'm sure anyone who has used WPF is familiar with the irritating boilerplate code surrounding properties, usually of this form.
...
0
votes
2
answers
114
views
Descriptor to restrict input [closed]
We start off we the following Person class:
...
6
votes
1
answer
2k
views
Change tracking POCO entities
Description
In a time where thin clients, web browsers, web services and micro services are prevalent, we tend to forget we still have to deal with thick and smart clients. Many applications in B2B ...
5
votes
1
answer
648
views
C++ bare getter setter with dispatch
I am trying to achieve a getter/setter behaviour that will reduce code in C++. The interface I would like to achieve is for example:
...
2
votes
1
answer
1k
views
Create a csv of file attributes recursively from a directory parameter in PowerShell
I'm a bit new to PowerShell (version 5) and was wondering if there are any improvements I could make to the following script. Any suggestions for style, code, etc. are all welcome.
The script creates ...
2
votes
1
answer
435
views
Is this a proper way to cancel an onMouseOver which uses setTimeout? (Vanilla JS)
I've got a working solution for an onMouseOver event which rolls over a set of images and replaces them in the element. Due to my lack of knowledge in JS I would ...
4
votes
1
answer
14k
views
Python decorator to support static properties
Classes in Python do not have native support for static properties. A meta-class can rather easily add this support as shown below. Are there any problems programmers might experience if they use this ...