Difference between Observer, Pub/Sub, and Data Binding

There are two major differences between Observer/Observable and Publisher/Subscriber patterns: Observer/Observable pattern is mostly implemented in a synchronous way, i.e. the observable calls the appropriate method of all its observers when some event occurs. The Publisher/Subscriber pattern is mostly implemented in an asynchronous way (using message queue). In the Observer/Observable pattern, the observers are aware … Read more

Using Spring, mapping to root in web.xml, static resources aren’t found

The problem is that requests for the static content go to the dispatcherServlet, because it’s mapped as <url-pattern>/</url-pattern>. It’s a very common problem in applications with “RESTful” URLs (that is, without any prefix in the DispatcherServlet mapping). There are several possible ways to solve this problem: Since Spring 3.x the preferred way to access static … Read more

MVC (model-view-controller) – can it be explained in simple terms? [closed]

How about this – off the top of my head, hopefully it works for you. MVC can be metaphorically related to a TV. You have various channels, with different information on them supplied by your cable provider (the model). The TV screen displays these channels to you (the view). You pressing the buttons on the … Read more

What is MVC and what are the advantages of it? [closed]

MVC is the separation of model, view and controller — nothing more, nothing less. It’s simply a paradigm; an ideal that you should have in the back of your mind when designing classes. Avoid mixing code from the three categories into one class. For example, while a table grid view should obviously present data once … Read more

Fat models, skinny controllers and the MVC design pattern

It’s a bit tough to give you the “right” answers, since some of them deal with the specifics of the framework (regardless of the ones you are working with). At least in terms of CakePHP: Yes Anything that deals with data or data manipulation should be in a model. In terms of CakePHP what about … Read more

How does differential execution work?

Gee, Brian, I wish I had seen your question sooner. Since it’s pretty much my “invention” (for better or worse), I might be able to help. Inserted: The shortest possible explanation I can make is that if normal execution is like throwing a ball in the air and catching it, then differential execution is like … Read more

What is the difference between MVC and MVVM? [closed]

MVC/MVVM is not an either/or choice. The two patterns crop up, in different ways, in both ASP.Net and Silverlight/WPF development. For ASP.Net, MVVM is used to two-way bind data within views. This is usually a client-side implementation (e.g. using Knockout.js). MVC on the other hand is a way of separating concerns on the server-side. For … Read more

What is a Data Transfer Object (DTO)?

A Data Transfer Object is an object that is used to encapsulate data, and send it from one subsystem of an application to another. DTOs are most commonly used by the Services layer in an N-Tier application to transfer data between itself and the UI layer. The main benefit here is that it reduces the … Read more

tech