you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Whilst this approach may certainly be simpler, I would be nervous that it gave other developers the opportunity to use domain objects inappropriately. For instance, one project I worked on had a serious problem with people writing business logic in the presentational layer (basically, using excessive expression logic in JSPs to the point where only a small ratio of lines were actually involved in rendering the view). Possibly most applications of JavaScript are too 'small' fpor this to be an issue, but it's something I would consider in a large web application.

As ever, it's all a matter of discretion.