Design Methodology & Logic
Contents Under Construction



Design Methodology & Logic
------------------------------------------------------------------------------------------------------------------------------------------  

I have had a lot of people ask me how to begin programming, how to begin scripting, and my answer is always the same: Just start doing it.  The more you delve into the unknown, the less mysterious it will seem. 

You know what really drives me crazy are those self-paced books.  They are missing so much structure right from the beginning, that it’s amazing to me that anyone learns to program at all.

Hello World! is NOT a program/script of any kind.  Everything you learn needs programming structure and basic logic right from the beginning, otherwise you start acquiring bad habits; bad habits including not documenting your programs, missing logs, and forgetting to clean up after processing is complete.   I have a very simple design methodology I have been using for quite some time (of course you may develop your own as well).

I will list each item, and then you can apply your script where applicable.


So..here we go, this is the basic order of operation:

 

Will your script have a header?
All your scripts need a header.  It's pretty self-explanatory, so here it is.


‘ *************************************************************
  Script Language:  Name of script language goes here

  Script Name: Name of the script goes here

  Purpose: General purpose of your script

  Usage:  How to process your script

  Creation Date: Date you created your script

  Last Modified: Last date you modified your script.

  Author: Your name goes here

  E-Mail: Your email address here

  Comments:  any other comments pertaining to your script go here

‘ *************************************************************

 

What variables will you be using? 

Define your variables – this will be a little different depending on what language you’re using.  It would look something like this in Vbscript:  Dim MyVar1, MyVar2, MyVar3 AND strMyVar = objVar and like this in batch: Set PCNAME = %computername%.

 

Are you sure you want to execute? 

This is a Yes or No decision routine – You want to make sure that the script is intentionally being executed.  To the person executing the script it will be a pop-up asking them are they sure they want to install/run this script.

 

Are your resources available? 

Verify your resources – I like to know that the files, servers, and computers are available that I will be utilizing.  There are many ways to do from an IF EXIST or a valid ping.

 

Will you want end-users to see their icons or other processing during script execution?

I like to add a pop-up splash screen, very simple but effective.  It allows you to add a professional touch as well.  There are many ways to make pop-up screens, I like using a HTA.  Keep your splash screens simple and professional. 

 

Will you show a progress bar?

You will most likely want to show some type of progress bar.  It doesn’t have to be of actual progress, but does need to be animated, to let the end-user know something is happening.  Otherwise, you have an end-user who reboots or shuts off the computer right in the middle of your program not realizing a program is running.  There are many ways to make progress bars, from VBScripts to GIFs in a HTA.  Keep your progress bars simple and professional.

 

Do you need to get information from user or their computer?

At this point, you query and instantiate resources, if necessary, from the user or computer and get it assigned to variables.  Usually these will be temporary variables especially if you’re processing a long list machine names via a text file or array. 

 

What command do you want to process?

Okay, now comes the time where you get to run the command/commands or process subroutines.  This is where you add your commands, the processing part of the script.

 

Has your command completed?

You can monitor whether your command has completed.  If it has completed, then continue to next step.  If it has not completed, then wait.  Many languages have built in waiting, so you may not need this.

 

Do you know logging?

I know not everyone uses this, but they should.   Logging is a very important program/script item that should not be omitted.  It allows you to track successfully and unsuccessful processing, as well as future troubleshooting to be done, perhaps by even another person other than you; it makes it easier for everyone, I said use it!  :-)   A basic log contains date, time, process name, and whether it was successful or not.  Adding a local log into the application event log (which can be seen with the  event viewer under the application log) and a remote log (stored somewhere on your network) is common practice.  Keep your logs simple and professional.

 

Are you ready for cleanup?

Once the command processing is complete, you will want to run cleanup.  Cleanup is different for every program, but you basically want to end processes and delete files no longer needed.

 

You are ready to end progress bar.

Now that your command is complete and cleanup is complete, end progress bar.

 

Dialog popup for task completion for user.

Now that your progress bar is complete, notify user with a simple popup box.  This can be something as simple as “Program Installed Successfully!”

 

You are ready to end splash screen.

Once user hits the OK on the last dialog box, end splash screen.

 

YOU ARE DONE!  It seems like a lot of work, but from the end-user side, it was a normal  installation, which is what you want:  Happy end-users.

 

Script to be added here...

 

MrNetTek@gmail.com

------------------------------------------------------------------------------------------------------------------------------------------

 






.About

..I'm a Computer  
..Systems Engineer


..L
iving and loving life



.
Author
..









      process