|Unit 3 - Lesson 1: Application Design Issues
|Page 1 of 1|
|Author:||tlwiechmann [ Wed Jun 29, 2011 8:24 am ]|
|Post subject:||Unit 3 - Lesson 1: Application Design Issues|
Model View Controller
Note: Make sure you read the Wikipedia references.
Modern applications are build using design patterns (http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29) where possible. One fundamental pattern that is used in building applications is the Model-View-Controller (http://en.wikipedia.org/wiki/Special:Search?search=mvc).
In the process of writing applications, you will notice that certain bodies of code start to look the same with some specific differences. It is at that point you should write a reusable (http://en.wikipedia.org/wiki/Reusability) body of code (routine or subroutine) that can be called, passing in the specific information via parameters. In many cases the reusable code is specific to your application. However, when you see patterns appearing across many applications, it generally regarded as universal and gets published for everyone to use. This is what happened back in 1995 when the Object Oriented paradigm swept the industry. Erich Gamma et. al. published a book titled Design Patterns: Elements of Reusable Object-Oriented Software. Since then, all these patterns have been published within Wikipedia.
When writing the workshop exercises for this course we will initially write what I call “literal” programs with no regard to reusability. As we do this, the patterns will start to jump out at you. At that point we will start writing reusable code. This is the iterative approach to software development, write and rewrite, evolving the functionality to what the user specified and creating a library of reusable code. In fact, the MUMPS Programming II course is dedicated to evolving the “literal” code base to a very generalized code base that can be reused. When finished, our application should be implemented using the M-V-C pattern so that any user interface can be applied.
Dealing with Errors
In Unit 2 – Lesson 6 we covered how to write a simple error processing routine. I made the statement that it is very important to have an error processing framework put in place to capture error information. It facilitates debugging. There are two tools available to you. The are:
First, Cache and MUMPSV1 utility %ET permits you to trap errors and log them. They are extremely helpful. You simply enter this code in the first line of your routine:
Set $ETrap=”Do ^%ET”
To my knowledge GT.M does not have a utility like this. If you feel up to it, write one!
Second, each MUMPS system has a built in debugger. It is implementation specific and will not be covered here. However, take a detour and learn how to use it for the MUMPS system you are using. Trying to guess as to what causes an error is a huge waste of time.
Database Design issues are extremely important when designing an application. However, at this point in the learning process we will not be concerned about them. We addressed the issue of packed record verses node storage previously. These issues will be addressed as we proceed.
|Page 1 of 1||All times are UTC - 8 hours [ DST ]|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group