Questions tagged [model]
Abstract representation that allow to understand and reason about software and data structures, or that describes a real-world structure for the purpose of dealing with it in software.
125 questions
0 votes
4 answers
422 views
Should I model constraints which are valid, but which have no current function in the domain?
When domain modelling, should a valid constraint - or "natural" constraint - be modelled, even if there are no current business processes which rely on the constraint being asserted. As an ...
0 votes
2 answers
383 views
Do I use a model or controller in an existing MVC application for implementing an integration that makes API calls?
I have an existing application using Codeigniter Framework (MVC). I need to implement an integration in the software with the external cash register (e.g., making REST API calls). I need to either ...
1 vote
2 answers
229 views
Placing business logic on a not so small/big project
I am having a bit of problem trying to find the correct place for business logic. The project I am working on isn't huge, but is not small either and has a very considerable importance in my company. ...
0 votes
0 answers
54 views
Choosing a Pattern for Handling Different View Models in a Service Method
I'm working on a fairly large but standard dotnet core API. Here's a simplified sample: // Simplified example of a controller public class VehiclesController : ControllerBase { private readonly ...
3 votes
1 answer
191 views
Should I have different instances of the same model in an application or just keep a single instance?
What is correct in your opinion regarding the creation and handling of models in an application let's say using MVVM, or even an MVC design pattern? I will try to illustrate the situation I see at my ...
0 votes
1 answer
524 views
Multiple models/controllers python app
I am trying to tinker with the MVC pattern and I have a problem when trying to design the MVC structure. I need a model for products, however as I need to manage more and different data, I can help ...
0 votes
0 answers
137 views
Models as data containers in MVVM
In the past, when I've used MVC, my model objects were just dumb data containers. Everywhere I read says that in MVVM, models should contain business logic as well as being a data container. Now that ...
2 votes
2 answers
200 views
Should you pass an instance of service to a model class?
Say we have these view model classes. You can imagine there's an entry in the UI for each subtype of InfoItem, and each item contains some text and an icon. abstract class InfoItem(text: String, icon: ...
-1 votes
1 answer
320 views
Why is CMYK more suitable than RGB for printing? [closed]
We know that RGB is additive color model and CMYK is subtractive color model. RGB starts with darkness (black) and we gradually add light; an CMY(K) image requires to be illuminated by white light. ...
-1 votes
2 answers
96 views
Methods to model mutations performed by functions
Given a set of interfaces, objects implementing those interfaces, and functions that use those objects, what methods exist to model mutations performed by the functions? For example, given: A Pet ...
1 vote
2 answers
464 views
Model updating itself in MVC?
My group in school is tasked with creating an application of our own choosing which follows good object oriented design principles. The group has chosen to make a tower defense game with help of ...
1 vote
0 answers
1k views
Should I run validation logic on the DTO or the entity model?
Suppose I have a Controller that takes a DTO that represents an Order. This DTO has inner DTOs that could potentially have entity IDs and/or entity data that's used to create an entity dynamically ...
1 vote
1 answer
158 views
How to prevent mutual dependencies when implementing database relationships
To explain the problem imagine you have two entities User and Group. The OO implementation has two classes UserModel and GroupModel. UserModel should have a method getGroups() (returning instances of ...
4 votes
2 answers
955 views
How to model classes that can be extendable?
I have recently inherited a codebase which has a weird problem and I am trying to search for an extensible solution that can solve my issue. Consider I have a model class that is used as a model to ...
-1 votes
1 answer
81 views
Model design for `Team`s and `Member`s
Say we have to create a model for a company, where employees can be part of many different teams. A team can have member members. Members can be part of many teams. How to design database tables for ...