{"id":12078,"date":"2014-03-17T09:51:07","date_gmt":"2014-03-17T07:51:07","guid":{"rendered":"http:\/\/mozaicworks.com\/?p=6448"},"modified":"2014-03-17T09:51:07","modified_gmt":"2014-03-17T07:51:07","slug":"building-changeability-in-design","status":"publish","type":"post","link":"https:\/\/mozaicworks.com\/blog\/building-changeability-in-design","title":{"rendered":"Building Changeability in Design"},"content":{"rendered":"

Development teams everywhere are under increased pressure to deploy more often. In the age of Internet, we can instantly delight thousands of users through a small improvement. It\u2019s rare nowadays even for business customers to be happy with release cycles of years; one year for a new release sounds too slow. A few months is the norm.<\/p>\n

Reducing the length of release cycle is impossible without designing the software with change in mind. Yet we have learned in the hard way that designing too much flexibility for the future brings more trouble than benefits in the medium and long run. That\u2019s how the YAGNI (\u201cYou Aren\u2019t Gonna Need It\u201d) principle was born.<\/p>\n

Developers everywhere are challenged to find the balance of designing just enough flexibility into the system. What can help us meet this challenge?<\/p>\n

Why Software Design?<\/h2>\n

To answer this question, we need to go back to basics. What is software design? Who needs it? Why?<\/p>\n

Not that many years ago, many programs were written in a language similar with this:<\/p>\n

section\t.text\r\n    global _start   ;must be declared for linker (ld)\r\n_start:\t            ;tells linker entry point\r\n    mov\tedx,len     ;message length\r\n    mov\tecx,msg     ;message to write\r\n    mov\tebx,1       ;file descriptor (stdout)\r\n    mov\teax,4       ;system call number (sys_write)\r\n    int\t0x80        ;call kernel\r\n\r\n    mov\teax,1       ;system call number (sys_exit)\r\n    int\t0x80        ;call kernel\r\n\r\nsection\t.data\r\nmsg db 'Hello, world!', 0xa  ;our dear string\r\nlen equ $ - msg     ;length of our dear string\r\n\r\n(source: <a title=\"Assembly Programming Tutorial\" href=\"http:\/\/www.tutorialspoint.com\/assembly_programming\/index.htm\" target=\"_blank\">http:\/\/www.tutorialspoint.com\/assembly_programming\/index.htm<\/a>)<\/pre>\n

With just a few simple keywords and an intimate knowledge of the CPU internals, programmers were able to write code in the assembler language. This is probably the fastest implementation of \u201cHello world\u201d, so why aren\u2019t we using assembly today?<\/p>\n

It had a few problems. First, the code is difficult to read. Writing large applications would be very difficult in this language. Second, the code needs to be rewritten or changed for each CPU it works on. In other words,we needed another language for programmers, not for computers<\/strong>.<\/p>\n

I have come to the conclusion that this is the essence of software design.<\/p>\n

Software design<\/strong>\u00a0means structuring the code so that:<\/p>\n