fhg
Volume 11, Number 23 -- August 10, 2011

ILE: Decisions, Decisions, Part 2

Published: August 10, 2011

by Susan Gantner

In an earlier tip, I explored questions I often hear about binding directories. In this tip, I'll explore another commonly asked ILE question and give you my perspective.

Question: How many service programs should I have and how big should they be?

Answer: It depends.

Don't you hate that answer? But in this case, I do think it is completely application dependent. Often when I am asked this question, the emphasis seems to be related to performance. But I don't think the decision on the "what" or "how much" to put into a service program should be made based purely on performance. These days, developer time is a far more valuable commodity than system performance. So organizing callable functions by some logic that makes them easier for developers to find and use is far more important than how they perform at run time. That said, for those of you who still have performance concerns, here are a few thoughts on the subject.

First, a service program is activated in each user's job all at once, not one procedure at a time. So that's why it would be best to have more than one service program--at least assuming you have more than a handful of service program procedures. It is always best not to activate more code than is necessary. In other words, avoid activating lots of code that will never actually be used in that job.

On the other hand, once the service program is activated, it typically stays around for a long time. In other words, it doesn't need to be activated for each program or application that uses it, so you don't pay the "cost" of activating a service program over and over in a job unless, of course, you keep reclaiming the activation group the code runs in.

It may also be important to understand what "activation" of a service program (or for that matter, a program) entails. It does not mean that the code begins to run; no files are opened, for example, as part of the activation process. However, the static storage necessary to run the code is allocated in the user's job. The more static storage the program or service program uses, the longer the activation time. This kind of begs the question: How much static storage do my service programs need?

Assuming that--like most shops doing ILE--your service programs are made mostly of RPG subprocedure code vs. RPG code not surrounded by P specs, then the answer is that most likely your service programs use relatively little static storage. Since, by default anyway, local variables in a service program do not use static storage, shops that use mostly subprocedure code with local variables will have little static storage in their service programs. Global data in modules with subprocedures (including both globally defined files as well as global D specs) always use static storage. So if your service program procedures use a lot of global data, they will take a bit longer to activate.

But far more important than activation time is the time it takes a developer to find a service program procedure to use in their code. Or, worse yet, the time they waste re-writing the code because it was too cumbersome to locate a function that already exists. somewhere.

That's why my answer to the original question is: It depends. It depends on what organization of the code works best for the developers who are the most likely consumers of the reusable code in the service programs. After all, the only reason to put code into service program at all is to make it easily reusable.

For another perspective on this subject, take a look at words of wisdom from IBM's RPG architect, Barbara Morris, including advice on how to determine how much static storage your modules use.

I'll address other frequently asked ILE questions in future tips.


Susan Gantner is half of Partner400, a consulting company focused on education on modern programming and database techniques and tools on the IBM i platform. She is also a founding partner in System i Developer, a consortium of System i educators and hosts of the RPG & DB2 Summit conferences. Susan was a programmer for corporations in Atlanta, Georgia, before joining IBM. During her IBM career, she worked in both the Rochester and Toronto labs, providing technical support and education for application developers. Susan left IBM in 1999 to devote more time to teaching and consulting. Together with Jon Paris, she now runs Partner400, and appears regularly at many technical conferences, including System i Developer's RPG & DB2 Summit. Send your questions or comments for Susan to Ted Holt via the IT Jungle Contact page.


RELATED STORIES

ILE: Decisions, Decisions, Part 1

How Many Modules Should Be in a Service Program?



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
SEQUEL SOFTWARE

If you're like most businesses, you're in a race for fast,
easy access to information. That includes information from
multiple databases, like DB2, Microsoft SQL Server,
Oracle, and MySQL.

The white paper,
The Race To Access Enterprise Data,
describes the goals you need to achieve
and the hurdles you'll face.

And, it reveals how quickly and easily SEQUEL can deliver
the data you need, in the format you prefer, anywhere.

Follow this link to download.


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Edwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

PowerTech:  2011 Security Event of the Year. September 22–23 in Las Vegas. RVSP today!
New Generation Software:  BI comes in many flavors. Get info and FREE ice cream!
System i Developer:  Join the Gurus at the RPG & DB2 Summit in St. Louis, October 17-19


 

IT Jungle Store Top Book Picks

BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

The iSeries Express Web Implementer's Guide: List Price, $49.95
The iSeries Pocket Database Guide: List Price, $59
The iSeries Pocket SQL Guide: List Price, $59
The iSeries Pocket WebFacing Primer: List Price, $39
Migrating to WebSphere Express for iSeries: List Price, $49
Getting Started with WebSphere Express for iSeries: List Price, $49
The All-Everything Operating System: List Price, $35
The Best Joomla! Tutorial Ever!: List Price, $19.95


 
The Four Hundred
Lean Mean Green Screens

IBM Uncorks RPG Open Access Trial Version

The OCEAN View: More Skills, Less Blame

Mad Dog 21/21: Debit And Taxis

Vision and Maxava Prep for November Trial

Four Hundred Stuff
IBM i Server Gets Hip to QR Codes

IBM's Multi-Faceted Mobile Strategy

VAI Gets Social with New Release of S2K Salesforce

Three IBM i Solution Editions Unveiled by Infor, IBM

ClearPointe and EView Pair Up for Remote Management of IBM i Servers

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
September 25, 2010: Volume 12, Number 39

September 18, 2010: Volume 12, Number 38

September 11, 2010: Volume 12, Number 37

September 4, 2010: Volume 12, Number 36

August 28, 2010: Volume 12, Number 35

August 21, 2010: Volume 12, Number 34

TPM at The Register
IBM yanks chain on 'Blue Waters' super

Chip makers to strut their stuff at Hot Chips 23

Cray CTO Scott departs

A mixed bag for IT jobs in July

Rackspace: 'OpenStack opens doors, wallets'

New customers drive Teradata to new heights

Amazon virtual private clouds go global

Dell floats Cloud Hadoop clusters

VMware backs down on vSphere 5 virtual memory tax

Mainframers drop EU antitrust complaints against IBM

Servers pump up Super Micro

PC chip sales up, shipments flat in Q2

THIS ISSUE SPONSORED BY:

Bytware
SEQUEL Software
WorksRight Software


Printer Friendly Version


TABLE OF CONTENTS
Adobe Flash Builder for the iSeries Programmer, Part 1

ILE: Decisions, Decisions, Part 2

Admin Alert: An Alternate Way to Port Image Catalogs Between Systems: QFileSrv.400

Four Hundred Guru

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2011 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement