If you have to store your text strings for internationalization (i18n) on the server, that's one thing. But, if you can store them in Javascript, you might think about using RequireJs and its i18n plugin, because it makes it nice and easy.
Our app throws all sorts of exceptions. Well, it doesn't usually. It shouldn't normally. Er... But, when it does we want to put in some handling so that the app doesn't blow up in some unsuspecting user's face. And even then, sometimes we want special handling for certain exceptions and make sure others are just caught. And that's what we'll do with AccessDeniedException.
Spring Security (previously Acegi) gives you an awesome AOP way of locking down methods in your Java application. And well-placed lock down is a special power indeed. However, Spring disappoints a bit on this score because it turns out its default behavior is to 'or' the roles listed in @Secured annotation. You'd think the default would be the stricter 'and', but alas. But never fear, there is hope.
In Java Land, everything is tied up in multiple layers of multi-colored wrapping paper. The abstraction often provides niceties and protections and convenience, etc. But, sometimes it practically makes you forget where you are. For instance, why would anyone write a little howto on requesting something over the web from the context of the web. That should be easy, right? Well, yes, I think so. And it turns out it is in Java, as it is in many other languages. It's just that there you're super close to the HTTP protocol all the time, and in many Java ...
Django comes with some awesome CLI tools. Manage.py is a beast of magic and lore. And it loves the fantastical kingdom of Heroku, where is romps with merry measure twixt the ether. But, when I've tried to go through a dumpdata of a previous site, syncdb on a migration to Heroku, and loaddata for moving the data, I've run into a snag on django_content_type_app_label_key more than once. Here are some resolutions.
When you start writing applications with BackboneJS, that means that you're dealing with some dynamic UI. There are elements being pushed into and pulled out of the DOM. I was having problems trying to reference DOM elements that were dynamically inserted into the DOM by other Backbone views. The fix was simple but not immediately obvious without cracking open Backbone.
BackboneJS is setup to do some pretty sweet single-page app action. And of course, a single page app will probably be wanting to talk to web services on the server. And if your server code is doing the Java jive, then a great way to expose your REST services is via JAX-RS. It's as easy as Mikey singin' ABC-123!
In addition to some sweet Inversion of Control injection action, Spring brings flowers and baby deer. And it brings some nice database connection help. Spring JdbcTemplate is a vanguard of strength and ease for connecting to your favorite RDBMS. And it so happens that the DBA I'm working with right now digs the stored procs. So, we'll meet in the middle with some more goodness born of Spring.
As more application logic gets pushed into the browser for client-heavy apps, the need for javascript testing increases. Lately, I've been doing some Jasmine unit testing of an application that uses RequireJS. Here are some general pointers and potential pitfalls to watch for.
Backbone has a great inheritance mechanism. It's as easy as Backbone.Model.extend(). This much is obvious. Let's try a few other things, like: Subclassing our own classes, calling to super classes, adding subclass attributes, and adding various subclasses to a collection based on a super class.
Django's manage.py script comes with some great utilitarian commands. Two of my favorites are dumpdata and loaddata. I've used these commands recently to migrate a Django app's data to the same Django app now running on Heroku. Here's a little taste of the glory.
Unit testing is a required part of a healthy software development lifecycle and a balanced breakfast. But test-driven development is a rockin' part of an *awesome* development lifecycle. What's the difference? If you don't test-drive the dev of your MarkLogic XQuery, you may never come back to test again. Test-driven XQuery development will ease your headaches, put you into the plush seat of a developer with confidence, and rocket you down the road to making all your wildest dreams come true. Kachow!
As web developers we're used to being able to write a jQuery selector and easily get the DOM elements back on the page that we're looking for. In the case of jQuery Mobile, it's slightly more complicated because a "page" is a different beast.
Is negativism between developers the norm? Probably not, but it's common. Do developers ever compliment each other? Yes, but it sometimes seems rare. When I step back, it does in fact seem that there is sometimes a noticeable wealth of negativism and a noticeable lack of complimenting. The nature of software and its developers may contribute. But we can overcome our challenges.
I've seen a number of different ways that internationalized strings get put into Javascript code. Of all of them, I kind of like just bundling the resource bundle of key value pairs in Javascript files themselves, one for each language or something close to that. But, in a recent project, there were a few other constraints, so we did it another way.
This is lacking. It's been one of the few disappointments I've had with WatiN. It does not handle XPath support out of the box. I found several other posts out there on the same issue with work arounds but we found a pretty slick solution using JavaScript-XPath.
C# has an object called WebClient that makes it easier to execute POSTs and GETs. However, if you ever have to deal with managing cookies, the WebClient doesn't do this out of the box, which puzzles me. It's not too hard to implement though.
In reworking some code, I wanted to leverage some lazy loading goodness for properties of a class. Yet at the same time, return a list of all those properties for iterating. Reflection is an awesome way to accomplish this feat!
Using an Oracle database backend in conjunction with LINQ required use of a 3rd party tool called DevArt dotConnect for Oracle. However, when the database model is configured, it's hard coded to a specific database instance (Dev, Test, etc). I wanted to dynamically select which database instance to run against relative to the lane my tests were running against. It's actually easier than I thought.
IntelliJ IDEA is a great development environment. I enjoy it very much. It complements the OS of pleasure, Linux. I mostly the Ubuntu distro or a derivative. Here's a easy way to get yourself an IntelliJ launcher so you don't have to run the bin/idea.sh file if you don't want to.