Category Archives: Design

Factoring Functionality: Who Needs to Know?

There are many ways you can break the functionality of a program into blocks that are manageable: some right, some wrong.  This post promotes a simple principle.  The primary way should be around “who needs to know.”

Posted in Coding, Design, practice | Tagged , , , , , | Leave a comment

XML vs. JSON vs. YML

Here is a side by side comparison of the same data presented in three common formats.  How do they compare?  What are they good for?

Posted in Coding, Design | Tagged , , , , | Leave a comment

Safe API Upgrade

First consideration for any Application Programming Interface (API) is how it will evolve in the future.  This critical interface must stand the test of time, and should whenever possible be both upgrade and downgrade compatible. 

Posted in Coding, Design, practice | Tagged , , , , | Leave a comment

Let Me Save Incomplete Files

This is a usability problem that I have run into a number of times.   A programmer writes a UI screen to receive a long list of inputs in order to create an object in system.  Save is enabled only when … Continue reading

Posted in Coding, Design, Uncategorized | Tagged , , , | Leave a comment

The Magic of MemFile

In the Purple Utilities Library is a class called MemFile which you can efficiently stream into and out of. Learn to use it properly can increase the efficiency of your programs when reading and writing data.

Posted in Coding, Design, practice | Tagged , , , | Leave a comment

Keep Things the "Same"

This general design principle does not mean to never change anything, but to consciously create a paradigm where the same things have the same names and are accessed in the same way as much as possible.

Posted in Coding, Design | Tagged , , , | Leave a comment

Ultimate Java Exception Class

This is the third in a series about translatable exceptions (see Translatable Error Messages).  This post is about the class JSONException which contains the required features.

Posted in Coding, Design, Uncategorized | Tagged , , , | Leave a comment

Exception Receiving

When you make a web service call, you want to report the problem to the user save as you do for any other part of the program, and that is through an exception object.  This post talks about converting the … Continue reading

Posted in Coding, Design | Tagged , , , | 1 Comment

Variable Arguments for Messages

We need to construct an object which has a template and a set of parameter data values.  Java offers a couple of ways to do this, and this post shows how the variable parameter mechanism works easily and conveniently for … Continue reading

Posted in Coding, Design, Uncategorized | Tagged , , , | 1 Comment

JSON Translatable Error Messages

Second in a series on translatable exceptions, this discusses how an error message should be returned as JSON from a web-service API so that it the calling program can display the error in the right language for the user.

Posted in Coding, Design, Uncategorized | Tagged , , , | 2 Comments