YOUR FEEDBACK
More on the Software Assembly Question - Do Design Patterns Help?
Yanic wrote: Hi, > UML and MDA are being changed to be more data and doc...
SOA World Conference
Virtualization Conference
$50 Savings Expire May 23, 2008... – Register Today!


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


PowerBuilder Standards and Frameworks
Building a better foundation

Digg This!

Page 1 of 2   next page »

Now that we understand workspaces and targets, we can start to get a feel for what type of infrastructure we want to use for our application.

As I mentioned in my last column (PBDJ, Vol. 12, issue 7), we need to answer some questions regarding standards and frameworks.

As Larry wrote about in last month's column (PBDJ, Vol. 12, issue 8), we also have to choose whether to include multiple applications in a single workspace, have a workspace contain one application, or perhaps have a workspace contain all applications related to a specific business area. Once those issues are resolved, we can start to think about our application design in terms of objects, user interface artifacts, database access, transaction management, and other items that are the meat of our infrastructure.

Contrary to the Borg's mantra of "Resistance is futile" in Star Trek, you should resist the temptation to just jump in and begin coding. You'll quickly find, no matter the size of the project, that some design goes a long way toward allowing you to be more productive more quickly. Think of it as pseudo-coding a difficult piece of logic. The pseudo-coding may seem like a waste of time - time that could have been spent on the actual coding. But, in reality, the exercise of pseudo-coding often points out that we had invalid assumptions, poor logic flows, or a convoluted and difficult design. The time we spend on the pseudo-coding should pay us back handsomely in terms of a sleeker, more complete piece of coding. Similarly, the time we spend answering design and infrastructure questions up front will provide us with a better foundation when we get down to actually building our application.

So, let's ask, discuss, and answer some questions.

What Is the Name of Our Application?
Seems pretty basic, huh? But, the truth is, this little piece of information forms the basis of our naming standards. If our application is named MarketTrader, our w_customer, for example, might be better named, w_markettrader_customer. Our w_account might be better named w_markettrader_account. Our base DataStore object might be better named n_markettrader_ds instead of n_ds. If MarketTrader seems a bit verbose, we could shorten the mnemonic to "mt" to yield w_mt_customer, w_mt_account, and n_mt_ds.

For this column, the application is "pbdj_CS", so we will use "cs" as the basis of our naming standards. This means that window names will begin with w_cs, nvos will begin with n_cst_cs, menus will begin with m_cs, and so on.

Do I Really Need to Prefix Each Object with a Mnemonic?
The short answer is "Yes." There are a couple of reasons for doing this. Prefixing an object with the application mnemonic allows you to recognize to which application this object belongs. If your workspace has multiple applications and they each have a w_about window, it can sometimes be confusing which w_about you are currently editing or where you are going to be saving it. Another reason for doing this is if you are using a framework that already provides a default implementation of w_about. For example, if you were using PFC, you would recognize that w_about exists in the PFE layer as the extension of the pfc_w_about. Best practices are to inherit from w_about to create your own application-specific version of the about box - in our case, w_cs_about.

Another mnemonic you may need to consider is to incorporate the application subsystem within your naming standard. This applies in cases where the same basic name could be used in multiple places within your application. For example, in our MarketTrader application, we may have both an equity trading window and a fixed income trading window. If we had only one, we would be inclined to name it w_mt_tradeentry. However, with the need for two trading windows (and the possibility later of adding ones for derivatives, precious metals, bank notes, etc....), we should probably incorporate the subsystem into the name. This might lead us to name our trade entry windows as w_mt_eq_tradeentry, w_mt_fi_tradeentry, w_mt_dv_tradeentry, etc....

Reviewing our choices for how we want to configure our workspaces and targets has a reasonable amount of influence as well. In our last scenario, if we had decided to have the MarketTrader application in its own workspace, we might choose to exclude the "mt" mnemonic altogether (except where absolutely necessary - like our w_about case above). Our trade entry window names would then become, more simply, w_eq_tradeentry, w_fi_tradeentry, and w_dv_tradeentry.

My personal preference is to have separate workspaces for each business area. In each workspace, I place all applications related to that business area. This would allow me to use the convention of w_eq_tradeentry instead of w_mt_eq_tradeentry in our MarketTrader application.

Do I Want or Need to Use a Framework?
If you're building an application that will not utilize at least 50% of a framework, it may not be necessary to use one. In effect you are carrying the weight of the entire framework for a small return. If portions of the framework can be decoupled from the whole, then the decision becomes much easier...just utilize those pieces of the framework that you need to use.

If I Don't Need Framework, I Can Get Started, Right?
Even if you choose to not use a framework, there are a number of "base" objects that you absolutely should create for use in your application. In fact, these objects can be placed in a library and reused across multiple projects (see sidebar for a discussion of sharing .pbls across multiple projects). These objects include ancestor objects of type window, MDI sheet (main), transaction, DataStore, and DataWindow and may also include response window, about window, command button, menu, and appmanager.

The reason for this is simple: it allows for flexibility and extensibility in your application. It is much, much, much simpler to change or provide new functionality in one ancestor than it is in 20 descendant objects.

For example, if you wanted every window to have the application icon associated with the window, do this at the base ancestor window level. The icon property will be inherited to all other windows. If you decide to change the application icon and, consequently, the icon at the window, you have to modify only one object. The icon attribute can always be overridden at a descendant level if the need arises. Let's say you have the following window class structure:

w_base
   w_sheet
     w_customer
       w_eq_customer
       w_fi_customer
       w_pm_customer
     w_account
       w_eq_account
       w_fi_account
       w_pm_account
     w_tradeentry
       w_eq_tradeentry
       w_fi_tradeentry
       w_pm_tradeentry

Set the icon property of w_base to be the same .ico file as is associated with the application object. If you decide later in the project development cycle that the customer windows should have an icon specific to customer and the account windows should have an icon specific to account, then you make two changes - in w_customer and w_account - not six changes.


Page 1 of 2   next page »

About Steve Katz
Steve Katz is a senior developer at HSBC Bank USA and has extensive experience developing applications utilizing PowerBuilder, Java, and other technologies. He has used PowerBuilder since v2.0a, taught at Techwave, and even wrote some articles about PowerBuilder a very long time ago.

About Larry Cermak
Larry Cermak is the president of Branick Consulting, Inc., an emerging technology consulting firm specializing in the Sybase products. Larry is a writer for the Sybase Developer Network and PowerBuilder Developer Journal, frequent speaker at Sybase conferences and seminars across the country, and has published the only book available on Web DataWindows. He has been helping customers move PowerBuilder applications to the Web since 1998 and has helped more than 30 companies.

Anna wrote: First of all, thank you guys for coming up with these articles. I've been using PB for a long time now but with the move we're planning to PB10 and EAServer I feel like a newbie again. Anyway, can you tell me where I can find this "(see sidebar for a discussion of sharing .pbls across multiple projects). " bec that's exactly what I'm planning to do when we make our move to PB10. Thanks and keep it up!
read & respond »
PBDJ News Desk wrote: Now that we understand workspaces and targets, we can start to get a feel for what type of infrastructure we want to use for our application. As I mentioned in my last column (PBDJ, Vol. 12, issue 7), we need to answer some questions regarding standards and frameworks.
read & respond »
PBDJ News Desk wrote: Standards and Frameworks. Now that we understand workspaces and targets, we can start to get a feel for what type of infrastructure we want to use for our application. As I mentioned in my last column (PBDJ, Vol. 12, issue 7), we need to answer some questions regarding standards and frameworks.
read & respond »
PBDJ LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
The PB Future: More on Graphs in PowerBuilder 11.5
Last week I posted a screen shot of the new 3D Rendering capabilities being added to some of the 3D graphs in PowerBuilder 11.5. It was met with mixed reviews on the PowerBuilder Futures newsgroup (forums.sybase.com) so I went back to the drawing board to see what I could come up with.
BluePhoenix Expands Modernization Collaboration with Microsoft
BluePhoenix announced that it has expanded its collaboration with Microsoft on legacy modernization projects. The collaboration provides customers moving their applications or databases to .NET-based environments the best in both modernization services and technical support. BluePhoeni
Sybase PowerBuilder Delivers AJAX and .NET Enhancements Enabling Rich Internet Application Development
Sybase announced that AJAX development capabilities and further Microsoft .NET enhancements have been added to the latest version of Sybase PowerBuilder 11, the premier 4GL rapid application development (RAD) tool. PowerBuilder 11.2 represents another milestone in the PowerBuilder road
PowerBuilder 11.2 Released: Sybase's Flagship IDE
Sybase has released the production version of its flagship .NET development tool - PowerBuilder version 11.2. This latest release of its premier IDE for RAD includes not only standard fixes but also a good list of new features. Here is the 'Coles Notes' version of these new features.
PowerBuilder Takes You To .NET
In June of 2007, Sybase released PowerBuilder 11. PowerBuilder developers can now deploy PowerBuilder components as .NET Assemblies or as .NET Web Services. A PowerBuilder developer can now create these .NET resources so that those who develop .NET solutions can benefit from PowerBuild
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING POWERBUILDER / SYBASE NEWS
Sybase and Sun Set Guinness World Record for World's Largest Data Warehouse
Sybase, Inc. (NYSE:SY), the largest enterprise software and services company exclusively