Questions tagged [object]
The object tag has no summary.
96 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
24
votes
16
answers
19k
views
How far can you push Object Oriented Programming?
A getter is a failure to design an object. It violates encapsulation which is a core principle of object oriented programing.
Now please tell me, how do you design a libraries hash table collection ...
-2
votes
3
answers
144
views
What are the pros and cons of different combinations of objects and arrays for data storing?
From the article JavaScript 2D Array – Two Dimensional Arrays in JS, I see one way to store data is to put all properties of each element into one array:
let dataRepresentation1 = [
['John Doe', ...
2
votes
3
answers
966
views
Why do we need factories in the first place?
I went through various blogs but nowhere I can find the reason of having virtual constructors in C++.
Why is virtual constructor needed and lets say if we go through the wrong way of creating virtual ...
0
votes
2
answers
135
views
Services: Which structure is a better idea?
I'm designing my service layer for a GraphQL API and there are many situations in which I can't decide if code relating to a table should belong in it's own class, or the class that 'owns' the data. ...
2
votes
1
answer
1k
views
Opaque objects on the stack / in structs
I have a collection of opaque objects and related functions API. Such objects are typically created on the heap, but that involves a non-trivial amount of overhead. And when aggregate together, that ...
4
votes
7
answers
5k
views
How do interactions between objects work?
I am getting confused when objects interact using OOP. Here i'm trying to model the interaction between a vending machine and a coin. The coin is inserted into the vending machine.
The interaction is ...
user avatar
user362602
1
vote
1
answer
220
views
If methods are actions that an object can perform, how do we represent abstract objects?
I have read that objects contain the actions it can perform as functions and its attributes as variables. But i am getting confused with objects that don't seem to perform any actions such as an ...
user avatar
user362602
2
votes
2
answers
2k
views
How to model relations in UML Class and Object diagram for simple Graph structure
I'm trying to model a simple Graph structure as an UML Class Diagram and Object Diagram. A Graph can have multiple Nodes and knows it's starting Node. Every Node has a predecessor and a successor Node....
1
vote
3
answers
525
views
Constructing an Object from Multiple Services
I have an object that contains several dozens of properties. A portion of property values come from Service A, others from Service B, and the remaining from Service C. This object is a flat model that ...
-2
votes
1
answer
63
views
Simple OO/normalization question - common fields in new table/separate object?
I am working on an app and creating models now. I think this is a basic 1N normalization question but am not sure. Should I break location/address out as a separate table?
Let's say I have Parents ...
1
vote
3
answers
177
views
Should we consider immutability for local scoped variables
I have the following code:
const string endPoint = @"foo{0}?pageNum={1}&itemsPerPage={2}";
const int itemsPerPage = xxx;
InvoiceCollection response = await _apiClient
.GetAsync<...
3
votes
5
answers
1k
views
Design pattern for objects in invalid states
General design pattern for object error state
Consider a simple class Wallet that models a wallet. A Wallet contains a certain amount of Wallet.Cash and it is possible to take money out / put money ...
1
vote
1
answer
57
views
Determine array of objects collective identity and be able to inspect it
I have an array of objects and I'm trying to see, through each request, whether or not a new member appeared in my collection.
The way I currently do it is, I require each member of the collection to ...
1
vote
1
answer
2k
views
HashMap versus Object ? Which one is better to finally generate JSON output with KEY and VALUE
I do have this use case.
callers(APIs in same microservice or different microservices) wants to report different KEYS and VALUES as an audit as part of their methods.
There is a high possibilities ...
1
vote
1
answer
7k
views
Ordered vs sequence in association in UML
I am trying to understand UML class diagrams.
Imagine two classes that are related with each other by association. What is the difference between {ordered} and {sequence} for the association?