® IBM Software Group Appendix C - Code Reuse - Program Templates - Code Snippets - Code Templates.

Slides:



Advertisements
Similar presentations
Interaction Design: Visio
Advertisements

Chapter 1: Introduction. Contents Whats New in Dreamweaver CS4? The Dreamweaver CS4 Interface Setting Up a Site Creating a Web Page Adding Text to Your.
In the top left corner of the page, click on Pages & Files. Click on the If Then Statements folder to select it. Click New – Create a Page. You can also.
Refresher Instruction Guide Strategic Planning and Assessment Module
Chapter 10—Creating Presentations
Microsoft Office 2010 Access Chapter 1 Creating and Using a Database.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
® IBM Software Group © 2006 IBM Corporation Additional AJAX Examples and Workshops This learning module provides additional AJAX use cases and examples.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Word Lesson 10 Working with Templates and Styles Microsoft Office 2010 Advanced Cable / Morrison 1.
Microsoft ® Office Word 2007 Training Mail Merge II: Use the Ribbon and perform a complex mail merge [Your company name] presents:
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
Using Microsoft Outlook: Basics. Objectives Guided Tour of Outlook –Identification –Views Basics –Contacts –Folders –Web Access Q&A.
1 Chapter Overview Creating User and Computer Objects Maintaining User Accounts Creating User Profiles.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 3 of 4 – Creating the U.I. Layer These slides walk you through the process of.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
EASY TEAM MANAGER By Dave Abineri EASYWARE: PO Box 231, Milford, OHIO (Cincinnati) Phone: (513) Use UP arrow to move to the NEXT slide Use.
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
Tutorial Introduction Fidelity NTSConnect is an innovative Web-based software solution designed for use by customers of Fidelity National Title Insurance.
Tutorial 1 Creating a Database. Objectives Learn basic database concepts and terms Learn basic database concepts and terms Explore the Microsoft Access.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
Customizing Microsoft Project
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
Lesson 4: Formatting the Worksheet
Word Create footnotes and endnotes. Course contents Overview: Be a footnote and endnote whiz Lesson 1: Add footnotes and endnotes Lesson 2: Beyond the.
Scottish Legal Aid Board Content Management using OpenCms Martin Spinks CTO Navyblue Tuesday, March 16, 2010.
® IBM Software Group © 2013 IBM CorporationLast Update: August 2013 Workshops RDz Workbench – Using the Data Source Explorer Workshops.
Advanced Forms Lesson 10.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Creating a Web Site to Gather Data and Conduct Research.
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 3: Working with People.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
® Microsoft Access 2010 Tutorial 1 Creating a Database.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 3: Customizing Document Elements.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
Word Revise documents and keep track of changes. Use Track Changes and comments Course contents Overview: Insertions, deletions, comments Lesson 1: Stay.
Fall 2005 Using FrontPage to Enhance Blackboard - Darek Sady1 Using FrontPage to Enhance Blackboard 1.Introduction 2.Starting FrontPage 3.Creating Documents.
Interaction Design Interaction Design - Joan Cahill - Visio Interaction Design: Visio.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
Key Applications Module Lesson 21 — Access Essentials
® IBM Software Group © 2006 IBM Corporation “Essential” HTML Tags and Page Development Techniques This Learning Module describes the standard HTML tags.
® IBM Software Group © 2011 IBM Corporation RDz Workbench – Debugging z/OS COBOL Applications Batch COBOL Debugging Workshop Jon Sayles, Rational System.
Chapter 17 Creating a Database.
Lesson 11: Looking at Files and Folders what a file or folder is on the computer how to recognize a file or folder on the desktop how to recognize the.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 2 of 4 – Creating the Business Logic Layer These slides walk you through the process.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco PublicPT Advanced 1 Packet Tracer: Advanced Session.
® IBM Software Group © 2006 IBM Corporation Finding Out Which Submit Button Was Clicked – and Other JSF Command Button Techniques This section describes.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 1 of 4 – Creating the Data Access Layer These slides walk you through the process.
Microsoft Word Level 1 Michael Carco. Word Level 1 Agenda  Word Basics  Navigating in a Document  Inserting and Modifying Text  Creating and Modifying.
Access Module Implementing a Database with Microsoft Access A Great Module on Your CD.
Clemson OLLI Presentation Template Instructions Important: Before starting to use this template, print out the following nine instruction pages.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Perform a complete mail merge Lesson 14 By the end of this lesson you will be able to complete the following: Use the Mail Merge Wizard to perform a basic.
Mail Merge Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter Introduction to Word Processing ITSW 1401 Instructor: Glenda H. Easter.
Tutorial 1 Creating a Database
 Create a Local Workstation Project
About SharePoint Server 2007 My Sites
Database application MySQL Database and PhpMyAdmin
Core LIMS Training: Advanced Administration
MS-Excel Part 1.
Multi-host Internet Access Portal (MIAP) Enhancement Guide
Creating and Modifying Queries
Presentation transcript:

® IBM Software Group Appendix C - Code Reuse - Program Templates - Code Snippets - Code Templates

2 Reusable Source Code – Snippets and Templates Reusing code has been a "holy grail" of software development for decades. While there is no silver bullet solution, there are a number of innovative and useful options in RDz for this:  Program Templates  Code Snippets  Code Templates We've already seen in previous slides that you can create new programs using templates, which allows you to create and enforce standards, and simplify development. Snippets allow you to create smaller, "packets" of reusable code – from single statements to routines. We'll first look at customizing the program templates: To access their defaults: From Window > Preferences > COBOL > Code Templates

3 Creating New Programs Using Templates  There are several ways to create new programs from scratch  The "Best Practice" method is to use RDz's COBOL program templates  From File, New > Other… …in the Wizards panel, cobol - Type: cobol - Select COBOL Program - Click Next > …in the COBOL Program panel, - Name the Program - Click Next >  Finally you specify which folder to create the program:  Select the cobol folder  Click Next > Note – You can create new programs

4 Creating New Programs From Templates – continued You can add CICS or DB2 template sample code to your new program:  Check the features you'd like Finish  Click Finish  A few things happen:  Your new program is created   The Snippets view is opened  Snippets information can be found in Appendix B of these slides  Note that you can customize the templates used to create new programs Window, Preferences, From Window, Preferences, select: COBOL COBOL –Code Templates –Features

5 OPTIONAL TOPIC – Create New Program in a z/OS LPAR  You can create new programs using the New COBOL Program wizard, provided you are connected to a z/OS LPAR, and that you have created a z/OS Project/MVS Subproject (see Location: in the screen capture below). MVS SubProjects and z/OS Projects are covered in another module of this course

6 Customize the New Program Templates – Comments You can create a custom Code Template for COBOL comments or the base program code itself. To add or customize comments:  Click the comment option you wish to modify  Code an asterisk in position 7 (you'll have to space over 1-6)  You can insert Variables that are filled in when new "templatized" programs are created

7 Customize the New Program Templates – Program Code And you can add your own entries, common files, databases, variables, routines etc. to either:  An entire program  Separate program divisions When a new program is created using the templates all of the custom comments and code are inserted.

8 Code Snippets Sometimes, instead of entire programs you might want to:  Save some code temporarily for reuse – similar to the ISPF: "CREATE" and "COPY" command line commands  Create a paragraph, computation, complex conditional – that can be re-purposed in other programs  Provide a library "standard" routines – using your shop's coding conventions  Provide a library of syntactically-correct and infrequently used/high-value statements:  Job Cards  Database routines  Complex COBOL code: UNSTRING etc. Snippets are the preferred way of doing this. You access them through a Snippets view, which you get to by:  From Window > Show View > other…  Type: snippets – and select the Snippets view On the right are a group of custom Snippets that we have created. You will see a subset of these in your workspace. Individual Snippets are contained in "drawers" which are the accordion menus that collapse/expand on-click. Snippets can be Exported and Imported (for sharing)

9 Using Code Snippets (ISPF "COPY" command line command) To use an existing code Snippet follow the steps below: 1.Place your cursor at the exact focal point (position in the source) where you want a code snippet inserted 2.Find your Code Snippet in the snippet drawers 3.Double-Click the Snippet 4.If there are variables in the snippet, you can:  Accept the defaults  Over-ride the values before the code is inserted 5.Click Insert

10 Creating Code Snippets (ISPF "CREATE" command) – 1 of 2 To create a new code Snippet follow the steps below: 1.Create a new Snippet category  Right-click over the Snippets view  Select Customize  From Customize Palette, under New Select: New Category  Name the Category  Add a description  Click OK 2.Select and copy the code you wish to Snippet-ify 3.Expand the category you wish to add the Snippet to, and select Paste as Snippet…

11 Creating Code Snippets (ISPF "CREATE" command) – 2 of 2 4.Rename the Snippet and give it a Description 5.Optionally add Variables to be filled in by Snippet users (or they can accept the defaults)

12 Using a Code Snippet for a Job Card In ISPF you might use the ISPF command line COPY command to insert a Job Card into a JCL deck. Let's try this with RDz  From the \ jcl \ folder, open: BR14.jcl  Select and Cut (Ctrl+X) the Job card  From the Snippets view, double-click: JOB Card  Enter a new JobName and a new MsgClass value  Click OK and verify your work

13 Using Code Snippets as a Scratch Pad Area for Multiple Paste Buffers Occasionally you may need to create multiple “copy/paste buffers” – if you need to say, replicate a set of changes across multiple programs. This can be accomplished using Snippets: 1.Open a program 2.Copy and create a Snippet from a code fragment Optionally customize the Snippet to include Variables – for generalized use 3.Create another Snippet 4.Repeat from step 1 until you’ve created separate Snippets for each code fragment 5.Apply the Snippets to your program(s) 6.Optionally Export the Snippets to other developers on your team

14 IMS The IMS Code Snippets If you are using RDz v7.6 or later, a number of very useful IMS Code Snippets are shipped with the product  These snippets go beyond simple text-based insertion to read your Data Division entries, and offer options for building statements using combo-boxes

15 RDz's Customize-able Content Assist Templates  Finally - you can customize RDz's template "proposals" offered in the Content Assist  You access this from:  Window  Preferences –COBOL –Templates  Customization options include:  Modify (Edit…) an existing template  Add a (New…) template  Remove a template  Export all templates – so that other team members can share  Import…  Restore Removed (un-delete)  Revert to Default (un-modify) You can customize a template's: - Content - Pattern - Context - where it's applicable - Description – hover help

16 Workshop –  OPTIONAL Workshop – Customizing Template Proposals  From Window, Preferences, COBOL, Templates:  Select one of the Template proposals and delete (Remove…) it  Select a Template proposal and Edit… (change it) – something simple like changing the case to mixed-case, instead of all UPPER case  Add a New… proposal, as shown here  You can copy and paste the this text. If Then If Else Else.  Test your work out in one of the sample programs, like: PATLIST.cbl

17 Code Reuse – Summary  Three methods of Code Reuse: 1. Program Templates  Useful if creating a new COBOL or PL/I program using the New program wizard  Can include standard (not customized) minimal CICS and SQL statements 2. Snippets  Most flexible and simple method of code reuse  Snippet scope can be from anywhere from a keyword to an entire program  Can define any number of custom variables to manage idiosyncratic requirements  Can export/import Snippets with Workspace  Can include Snippets view in custom Perspective 3. Code Templates  Most granular form of code reuse  Integrates with Content Assist  Typically used for statements – but could extend to more code (just, the interface is a little unwieldy)