Software Design Principles part 1 - SRP
package com.jippii.servlet.video;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.sql.*;
import java.security.*;
import javax.servlet.*;
import javax.servlet.http.*;
import freemarker.template.*;
import com.wrox.util.LogWriter;
import com.wrox.connectionpool.*;
import com.jippii.util.MultiPartInputStream.*;
// Markus Virtanen (c) 2001
// wirtanen@nic.fi
// Jippii Group Oyj
public class VideoServlet extends HttpServlet {
My software career started in 2001 when I worked for Jippii Group (nowadays known as Saunalahti) in Helsinki, Finland. That time I was a young guy building generic J2EE components such as gallup, feedback and flyer services that were easy to install to different sites of Jippii Portals, as well as video upload service for receiving bigger files. Those components were rather small and that time testing was not too much involved in the software process - at least in our company.
Now, several years later, I started to think what have been the biggest challenges I have faced in the software projects and I started to write a paper named "Extending Software Lifecycle" in which I try to describe how to produce quality software and what to beware in the software project and in the code itself. After all, source code is what counts (Jack Reeves, "What is Software Design"). Later I might create a course about the topic and provide it in addition to the Java Programming and Information Systems courses I have taught in Commercial College of Riihimäki.
Before saying anything about Software Testing or what I consider as ugly code (which I could easily receive from my friend Antti), I want to write shortly about Software Design Principles. This blog series starts today with SRP:
Single Response Principle (SRP)
Every object should have a single responsibility (only one reason to change) thus making the class more robust. For example if a class DocumentManager a) compiles and b) prints a document, there should be in fact two classes such as DocumentCompiler and DocumentPrinter. Compiler would then have the input-logic for fetching interesting information and building the document, where as Printer would deal with theoutput-logic for printer hardware etc.
BR,
/markus

