Be Compliant - In Your Own Way - With Flat File Templates

Intended Audience: Customers of Stat ACM, Developers & Administrators

Intended Subject: Making the end product compliant with Corporate Standards, while retaining your programming individuality… Are the two compatible? (Hint: Yes, there is a better way…)

Intended Reaction: Happy System Auditors & Developers

Keywords: Flat Files, Templates, Frameworks, Compliance, Programming/Coding Standards

Keywords to Make Developers Cringe: MISRA, Code Compliance and Team Programming Conventions


Hello Fellow Coders,
This blog will take a look at the contention sometimes created between those that require consistency in naming conventions, code formatting and coding standards, and the ‘How’ to adhere to
a corporate consistency - while retaining your Developers ‘Individuality’. The ‘give-away’ of this blog is that by using Stat File Templates – You can keep the Auditors/Program Managers happy – and still code ‘Your Way’.

Standards…

As xkcd points out below so effectively, like beauty, it’s in the eye of the beholder, or author.

Courtesy https://xkcd.com/927/, Randall Munroe

The Great Debate:

In the great debates of humanity, there are those that probably will never be solved: Dog or Cat? Mac or PC? Car or Truck? Any of these can spark a harsh pose from the ardent.

There is a never ending tug-of-war between the Pro & Con of each… and I’ll certainly not muddy the waters by diving into any of them. (BTW, I know exactly what I like. It’s whatever my wife tells me I like.)

What If?

What if we were able to meet in the middle on some of these? And No – I don’t mean running Windows on a Mac or bioengineering a canine-cat. (Besides, that’s a different blog I’m already working on.)

 

What I’m talking about is combining the best of both worlds. Provide your Developers with a Standard’s Framework that still allows them to show their Individual Programming Style within the bounds of the Framework.

 

Think of it as a “Coloring Book for Programmers”. You provide the wire frames; they choose the colors and levels of vividness from their own unique palettes.
The frame lets them know the boundaries and the rest is up to them – The way we like it. There will always be those that scribble outside the lines.
Don’t worry about them, they usually don’t last long at any one place before their code catches up with them and they slink out a side door. Instead, focus on those that like knowing the boundaries
so they know how high, and in which direction, they can jump before hitting a wall. They get to be Developers, which is what you pay them for.
And the Auditors and Compliance Managers get to do their job, which is what you pay them for as well. Stat File Objects Templates support the standardization of code by setting the ‘borders’ of the ‘picture’.

Creating Your Coloring Books (File Object Templates):

The coloring book you choose to create will be based on the specific languages and applications your Developers are supporting. Therefore, I will select a few from one of the common languages
and show you an example of setting one up. Let’s take a look at creating a multi-language template. SQR is a reporting language used in several different products such as PeopleSoft, Hyperion and others.

 

To create a new File Object Template, using whatever text editor or IDE you choose, simply create the template as you’d like and save it in the format of the target file object.

 

Below is an example of my SQR Template named “CustomSQR_Templ8.sqr”:

 

It’s a good idea to place “Hints” or indicators throughout the template that Developers can do a Search & Replace on to quickly personalize the new file as indicated above with Yellow Highlights.

Save this new File Object Template in a ‘common’ location, that Stat has access to, so that you are able to associate the File Object with the appropriate File Object Template.

Add Pages to Your Coloring Book: (Associate File Object Templates with File Objects)

To associate a File Object Template with a specific File Object Type, please do the following. From the Main Stat Tool Bar select Maintenance > General > Object Types.

Choose the “Object Class” that you want to work with. Highlight the row of the File Object you want to associate a new File Object Template with.
On the top of the window select “File Templates”.

Enter in a Name for the new File Object Template. Select the “View” button to point to the ‘common’ location from above and highlight the File Object Template.

Select “Ok” on the window. That’s it.

 

Coloring a New Picture: (Using a File Object Template):

Within the Version Control Module of Stat, go to the Objects Tab and add objects as you would normally add them.
When you want to create a new source file, or application file, choose “New Object” on the right side of the Objects window.

 

When you select the “New Object” button, the New Object window will appear. The first three fields will auto-fill for you.

The Source, indicated above by #1, is either “Existing Object” or a “Template”.

 

Under File Type, indicated above by #2, choose the File Type you want to create new.

 

In the Template Field, indicated above by #3, choose the File Type you want to create.

 

Enter a name in the New Object Name for your new File Object as indicated above by #4.

 

The last step is to select the “Create” button on the bottom of the pop-up window, #5 above.

 

When the pop-up window closes, the new file is created in the users “Working” directory and automatically added to the CSR.

Let’s take a look at the new SQR we just created: Simply right-click on the file object and select “Edit Object”.

And Stat will launch the file into the default application that the selected file type is based on. Much like if we were to double-click on the file in Windows Explorer.

Simply replace the space holders we created in the template and the Developer is on his way to finish the code by choosing the ‘colors’ they wish.

And it’s that simple! It’s a Once & Done Setup!

Additional Tips & Tricks:

- You can have several different File Object Templates based on a specific language or need.

- The File Object Templates you choose may be influenced by the programming IDE you have. Be sure to test your templates before releasing them.

-
Ensure you are creating a “Coloring” Book and not a “Paint by Numbers” Book. If/When Developers snarl about a particular framework being too stringent, that’s the hint that you are coloring outside the lines yourself.

-
Be sure the user’s “Working” directories are all setup properly for any file types where you have created a File Object Template. If not, the CSR will not save properly.

 

Going forward, you are now free to “Be Compliant – In Your Own Way”.

 

Thanks for reading!

 

Respectfully Submitted,

 

William R. Hart
Solutions Architect
Quest Software, Inc.

 

P.S. If being a Developer was easy, or if everyone agreed on easily adhered to standards, then if we did a Google search for “’Hello World’ Sample Code”, we would Not have 19 Million + unique hits returned.

About the Author
William.Hart
Promoting a positive Stat User Community and enriching the value of the Stat investment. William has worked with the Stat application for over twelve years. He specializes in the areas of PeopleSoft and...