Furthermore, most type system lack means to statically describe types such as “a list with at least two elements” or “a floating-point number larger than or equal to zero”.http://programmers.stackexchange.com/a/258281
Such requirements should be described as far as possible using static typing; anything else has to be worked around via run-time validation.
Thursday, January 7, 2016
Validation via Static Typing
Thursday, December 24, 2015
Header Tags for Structure not Presentation
The often misused header elements (<h1>--<h6>) are where we need to focus. The mis-use usually occurs with the headers not following in immediate descending order. In other words, the headers that should follow an <h1> element are <h2> elements. No <h3> elements should be direct descendants of the <h1> element. This paradigm should continue throughout the document. Also true of header elements is that they are used to convey the document's structure; they are not used for presentation within the document. If you need to create a section of code with larger text, use appropriate markup and do not simply throw in header elements to accomplish the task.Ajax: the Definitive Guide; O'Reilly 2008. pp 292.
Quote from section on leveraging header elements to drive a table of contents.
Tuesday, November 17, 2015
When to use Java over Drools
Some caveats to remember when using Drools are that it scales best when a large number of rules are executed against a small number of facts. It also makes more sense to use Drools when the rules are loosely coupled; if many rules depend on each other in a chain, it may make more sense to write an if statement decision tree in Java code instead of presenting the logic as a series of individual rules spread throughout one or more DRL files.https://www.credera.com/blog/technology-insights/open-source-technology-insights/using-drools-expert-apache-camel-part-3-embark-sample-route/
Saturday, November 14, 2015
Volatile accesses are synchronizing
...volatile accesses are synchronizing actions (docs.oracle.com/javase/specs/jls/se7/html/…), as such, they define an order for concurrent events which makes them equivalent to locking on the same monitor. – Cephalopodhttp://stackoverflow.com/questions/3786825/volatile-boolean-vs-atomicboolean
Saturday, August 22, 2015
What not to Test in MVP
When unit testing MVP applications, the recommended practice seems to be you should test presenters and not views. Services fall into a similar "don't unit test" category because they'll need to connect to the server-side, which won't be running in a unit testing environment.
https://dzone.com/articles/building-gwt-applications-mvp
Don't test the model either as it's just a glorified bag of getters and setters.
https://dzone.com/articles/building-gwt-applications-mvp
Don't test the model either as it's just a glorified bag of getters and setters.
Sunday, August 2, 2015
AngularJS is not MVC
Your template drives your application. It's treated as a DSL. You write AngularJS components, and AngularJS will take care of pulling them in and making them available at the right time based on the structure of your template. This is very different to a standard MVC pattern, where the template is just for output.
It's more similar to XSLT than Ruby on Rails for example.
DI Required for Declarative Transactions
[D]ependency injection is the only way that declarative transactions work. You will not get a transactional service if you use the new operator such as new BookService()http://grails.github.io/grails-doc/2.3.11/guide/services.html
Subscribe to:
Posts (Atom)