What are MVP and MVC and what is the difference?

Model-View-Presenter In MVP, the Presenter contains the UI business logic for the View. All invocations from the View delegate directly to the Presenter. The Presenter is also decoupled directly from the View and talks to it through an interface. This is to allow mocking of the View in a unit test. One common attribute of … Read more

What is null in Java?

Is null an instance of anything? No, there is no type which null is an instanceof. 15.20.2 Type Comparison Operator instanceof RelationalExpression: RelationalExpression instanceof ReferenceType At run time, the result of the instanceof operator is true if the value of the RelationalExpression is not null and the reference could be cast to the ReferenceType without … Read more

What is monkey patching?

No, it’s not like any of those things. It’s simply the dynamic replacement of attributes at runtime. For instance, consider a class that has a method get_data. This method does an external lookup (on a database or web API, for example), and various other methods in the class call it. However, in a unit test, … Read more