1,461 reputation
610
bio website
location
age
visits member for 3 years, 7 months
seen Jul 11 at 23:50

Jan
2
awarded  Yearling
Feb
2
awarded  Nice Answer
Jan
2
awarded  Yearling
Nov
21
comment Why put the business logic in the model? What happens when I have multiple types of storage?
In architectures with more careful layering, it would be something like UserRepository.find(). By "model" I meant the "model"-class provided by the framework, which you inherit from. The User-object returned by User.find() is a model of a user in the sense that somebody modeled what a user is, how a user behaves...
Nov
21
comment Why put the business logic in the model? What happens when I have multiple types of storage?
View-Controller-Model-Storage is rather crude, because it shouldn't be flat. For example, when a controller does something like User.find(...) to get a model, it asks the storage layer directly rather than going through the domain layer.
Nov
21
comment Why put the business logic in the model? What happens when I have multiple types of storage?
View-Controller-Model-Storage is the general principle (although the relationship between M, V and C should be visualized as a triangle). When your framework mixes storage into their "model", it works kind of like this: View-Controller-(Model inherits storage from framework).
Nov
21
comment Why put the business logic in the model? What happens when I have multiple types of storage?
Most MVC-frameworks kind of mix all the storage/database stuff into the model in order to make it easy to store your models (often by making you extend the frameworks model-class). This is probably the source of confusion. Technically, the model-code you write should be the actual model (domain layer), whereas the code provided by the framework should deal with storage (persistence layer). For example, something like User.find(...) (with User being a model) works because the framework implemented the repository pattern as part of the Model.
Nov
21
comment Why put the business logic in the model? What happens when I have multiple types of storage?
Sounds like you're describing a bastard of MVC and MVVM that has both controllers and view models. Also, I think the architecture you're describing may be a bit heavy for OP's needs.
Nov
21
answered Why put the business logic in the model? What happens when I have multiple types of storage?
Aug
16
awarded  Good Answer
Aug
1
comment What can be done to programming languages to avoid floating point pitfalls?
@supercat: What you're suggesting is just a poster-child of premature optimisation. The current situation is that the vast majority of programmers have no need whatsoever for fast math, and then get bitten by hard to understand floating-point (mis)behaviour, so that the relatively tiny number of programmers who need fast math gets it without having to type a single extra character. This made sense in the seventies, now it's just nonsense. The default should be safe. Those who need fast should ask for it.
Apr
24
answered How the Erlang get soft-realtime with GC?
Jan
2
awarded  Yearling
Nov
22
answered A programming language that does not allow IO. Haskell is not a pure language
Sep
14
answered What should I understand before I try to understand functional programming?
Sep
8
answered Can you write an unambiguous specification in a natural language like English?
Jul
17
awarded  Nice Answer
Jun
8
answered Why learn hexadecimal?
Jun
7
awarded  Commentator
Jun
7
comment Which open-source license is right for my project?
The GPL linking exception has been used for many years and does exactly that. Why do you believe it's not allowed?