Hot answers tagged

13 votes

What's the purpose of multiplying by 1024x1024?

It's difficult to be (at all) certain without looking at the code, but it kind of sounds like it's implementing fixed-point arithmetic, with 12 bits before the decimal point, and 20 bits after. When/...
Jerry Coffin's user avatar
  • 44.5k
10 votes
Accepted

Threads: the difference of concurrency between many-to-one model and one-to-one model

Your textbook isn't wrong, but it is using the term 'concurrency' a bit loosely at times. Concurrency means that there is the appearance that multiple tasks are being done at the same time. True ...
Bart van Ingen Schenau's user avatar
7 votes

“Smart create” method naming

Just have your create method and pass in some policies that supply additional functionality. Naming those policies should be easy.
Lightness Races in Orbit's user avatar
7 votes
Accepted

How do you correctly turn this text into an activity diagram (problem with timer)?

Problem Your diagram has several flaws. For instance, you'd need a join to synchronize the camera recording and the timer. But then, the semantic would mean that both activities must be finished ...
Christophe's user avatar
  • 75.9k
7 votes
Accepted

Why is CMYK more suitable than RGB for printing?

If you are working on image editing or graphic software, you probably wonder why you'd need to provide some more thoughts about color models: Colors you see on a screen are sent from a light source. ...
Christophe's user avatar
  • 75.9k
6 votes
Accepted

Mapping all properties of business objects vs Mapping needed properties of business objects

If you have exactly one app, and the server sends the JSON only to this app, you should go with @simon's advice. However, when you have a dozen apps, each of them needs a different part of the data, ...
Doc Brown's user avatar
  • 203k
6 votes

Class with large number of properties

In theory, it is better to have smaller classes when a logical grouping of the properties is possible. However, there are a number of cases where the cost of refactoring the class into smaller ones ...
Doc Brown's user avatar
  • 203k
6 votes
Accepted

Real case of append-only models

Classic (and probably the ones easiest to understand) problems for append-only are logging or monitoring systems. In case there are hundreds or thousands of sensors pumping data into your systems, ...
Volker's user avatar
  • 826
6 votes

In MVP, should we call repositories from the Model or the Presenter?

In my experience it depends on who you ask (but it shouldn't). I've seen your question asked about MVC, MVP, and MVVM. There is confusion about all three. But why is that? This is mainly the ...
MetaFight's user avatar
  • 11.5k
6 votes
Accepted

Models: two very different concepts

One issue with these discussions is the all-to-frequent mixing of different architectural viewpoints in the same discussion or diagram. Some architectural viewpoints are meant to show depth: deep ...
Erik Eidt's user avatar
  • 33.6k
6 votes

Should the Model be able to persist itself? When?

No, it should not. Especially these days, a model will have multiple persistence locations (DB, cache, backup) and a few other forms that are useful to be decoupled from the store (human readable, ...
Telastyn's user avatar
  • 109k
6 votes
Accepted

How to model classes that can be extendable?

How to model classes that can be extendable? In the field of software development, extensibility specifically refers to inheritance, and inheritance is not the correct approach here. The above class ...
Flater's user avatar
  • 47.7k
5 votes
Accepted

In MVP, should we call repositories from the Model or the Presenter?

In an MVP model, the presenter acts as middleman between the view and the model. In consequence, from the presenter you shall call the model and not short- circuit it by calling repository directly. ...
Christophe's user avatar
  • 75.9k
5 votes
Accepted

Should Modelling Document Analysis?

I think that Martin Fowler's posts about UML modes - UML as Sketch, UML as Notes, UML As Blueprint, and UML as Programming Language will be helpful to you. I also think that Scott Ambler's work on ...
Thomas Owens's user avatar
  • 80.4k
5 votes

Mapping all properties of business objects vs Mapping needed properties of business objects

Just map and send what you need. This keeps the code readable and reduces network traffic. However, make your code structures so that they are easily extendable when they have to be changed. Some ...
simon's user avatar
  • 187
5 votes

Should a Controller have a Model object as an attribute?

Yes, this is quite common (python example, simple java example, java example using a list of models, and C++ example) Why ? The controller must send commands to the model. So either it knows the ...
Christophe's user avatar
  • 75.9k
5 votes

Should you pass an instance of service to a model class?

Give your InfoItem a generic onClicked event. At the place (maybe a factory) where the specific InfoItem objects are created (and hence their type is known), assign each of them an appropriate event ...
Doc Brown's user avatar
  • 203k
4 votes

Mapping between 4+1 architectural view model & UML

Although I agree with Thomas Owens answers approach to cater for your end-users needs, one thing that is failed to be mentioned is that the reason why the original definition of the "4+1 View Model ...
Aphos's user avatar
  • 41
4 votes
Accepted

“Smart create” method naming

My approach is to: Use a name that indicates what happens, if not precisely, then at least unambiguously, instead of a name that simply gives some vague hint that what will happen will be outside of ...
Mike Nakis's user avatar
  • 32.1k
4 votes
Accepted

UML - Design Class Model diagrams

There are many UML diagrams. You are obviously referring to an UML class diagram: Yes: you choose the level of details that you want to show in your diagram. So you can very well decide to show ...
Christophe's user avatar
  • 75.9k
4 votes

Models: two very different concepts

In MVC, the Model is anything that is not part of the View or the Controller. In MVVM, the Model is anything that is not part of the View or the ViewModel. That should be easy enough to remember. If ...
Robert Harvey's user avatar
4 votes

What's the purpose of multiplying by 1024x1024?

The fact that this shift is done one way and then in reverse later suggests that this is perhaps a hack to provide use extra bandwidth in these values. That is, the 20 low-order bits are being used ...
JimmyJames's user avatar
  • 25.9k
4 votes

Placing business logic on a not so small/big project

We’ve learned over the years that most small projects grow over time. What starts as simple CRUD applications evolve into business critical systems and complexity increases exponentially. Sooner or ...
Rik D's user avatar
  • 4,674
3 votes
Accepted

What kind of diagrams should I use for design before starting a programming a project?

The first thing you have to do, is to get an overview on the requirements. Two diagrams that may help: The UML use case diagram , to identify the main functions offered by your system to the user. ...
Christophe's user avatar
  • 75.9k
3 votes
Accepted

Do I need to include all relationships in my class diagram?

First for the general case: A relationship that follows implicitly from other relationships could be left out. In your specific example, this is the case, because there is a one-to-one relationship ...
Miguel van de Laar's user avatar
3 votes
Accepted

Do context diagrams have cardinalities?

Most of the system analysis methods have in common the idea that a system has boundaries with the environment that surrounds it and with which it interacts. The term "context diagram" is used to ...
Christophe's user avatar
  • 75.9k
3 votes
Accepted

Rails' MVC vs Microsoft MVC - where to put logics?

In the Microsoft version of MVC, you have the heavy Controller implementation instead of the heavy Model implementation that a large portion of the development community uses. The ORM should be a ...
Adam Zuckerman's user avatar
3 votes

Business logic in the models?

I read on the internet that I should do as less as possible in the controller. What do they mean? They mean the Controller is a part of the UI. And you should do only UI-related things inside it. ...
Vladislav Rastrusny's user avatar
3 votes

Design suggestions needed to create a MathBuilder framework

You sound like someone who has minimal experience with software design. And for you I have one golden advice : DO NOT CREATE A FRAMEWORK! (all caps for emphasis). If you try building abstractions now,...
Euphoric's user avatar
  • 37k
3 votes
Accepted

Model "Clones" Adding Complexity to N-Tier MVC Project?

It sounds like your friend is suggesting a more ADM (Anaemic Domain Model) approach. Essentially you just have your Method-less DTO model and use it through all the layers. Your Data layer is not ...
Ewan's user avatar
  • 72.4k

Only top scored, non community-wiki answers of a minimum length are eligible