TweetFollow Us on Twitter

September 93 - New Software Architectures

New Software Architectures

Jesse Feiler

Now it's Bedrock-or MFC, or Component Workshop, or Object COBOL. The choices for application frameworks are increasing, and with them, the need to formulate strategies for development and conversion of applications. New application architectures are possible-but they carry with them costs as well as benefits: new architectures may require different testing mechanisms, retraining of both developers and maintenance programmers, and rethinking of source code and documentation procedures. And, of course, new architectures carry with them a major cost-they will become old architectures and newer ones will supplant them.

The extremes of dealing with new architectures are well-known. On the one hand, there are examples of projects which quickly adopt all new architectures the moment they come out-and never finish the project. On the other, there are notorious cases of projects in which no new architectures are adopted: the code may be (grudgingly) C++, but the file structures are all based on 80-column punch cards.

Choosing an appropriate path for a specific project need not be a matter of happenstance or temperament. There are some very specific strategies to follow in deciding on adoption of new architectures.

(Note: New architectures often provide new functionalities which can directly affect the substance of an application-the TFloatWindow class in MacApp 3, for example, which replaced a number of inelegant attempts to incorporate that functionality into MacApp 2. This article does not address the issues of new architectures that can provide new benefits. We are concerned with the thornier issue of new architectures that only indirectly affect the end-user-new architectures which benefit the programmer.)

finding and identifying new architectures

It may at first seem unnecessary to think about finding new architectures-most developers' mailboxes are full of literature. The decisions about choosing implementation languages and frameworks are often made with much study and due deliberation. However, within the scope of a given framework, there are many other design decisions involving new architectures that must be made-and must be made far more frequently and with fewer resources.

Whether the project is a conversion from an earlier version of the same work or from another framework or a "from scratch" application, all of the designers, engineers, and programmers approach the work with their own bags of tricks. As part of any project design, standards are set. These standards often suggest which features of a framework will be used, and which will not. For example, we have become so convinced of the power of TBehaviors in MacApp 3 that we question any override of TView or a descendant. In almost every case the functionality that we desire can be encapsulated in a TBehavior which is attached to the TView (or descendant) in question. This solves many problems (including perennial problems with ViewEdit) and encapsulates our application-specific code in objects much smaller and less complicated than TViews.

In order to set such standards, it's important to find the new architectures. A primary source is the promotional materials about frameworks-everything from reference manuals to advertising, to presentations at MADACON, WWDC, and other groups. This material has to be carefully edited: in early presentations about MacApp 3 the gViewServer concept was stressed strongly. gViewServer is valuable, but nowhere in the league of TBehaviors.

It's also important to keep up with the literature, including reading as many code samples as possible. Unfortunately, programmers often don't like to read code, and standard computer science training provides little education in reading and evaluating code (as opposed to designing and writing it). Nevertheless, reading enough ads, code samples, and manuals (for products you use and don't use) should alert you to trends. Different frameworks may implement the trends differently, but you should be able to keep your eyes and ears alert for important, common new architectures.

One final warning: be alert for "unique selling propositions" that aren't unique. We've all been through the blood feuds of Object Pascal and C++; some people are fanning some internecine strife over Windows and Bedrock. On close examination, competing frameworks often prove to have remarkably similar functionalities. If framework X provides a unique and wonderful feature (A) and framework Y provides a more-unique and more-wonderful feature (B), at root may be some simple architecture (C)-which is implemented in framework X, Y-and framework Z.

(Author's/Editor's note: We apologize for the use of letters in the preceding paragraph. Identifying the frameworks and the particular "features" referred to could put our lives in danger.)

evaluating new architectures

What Changes Does it Require?

One of the virtues of object oriented programming is that sections of programs can easily be swapped in and out: if a new and improved object for displaying text in various scripts arises, you can removed your old object that displays text (perhaps in only one script) and plug the new one in.

Unfortunately, we are still at the point where many of the new architectures don't work that simply. We are talking about new architectures, not new objects. So a new architecture often requires modifications to a number of existing objects, and is not simply a matter of replacing one object with another. One of the best examples of this is the TDialogBehavior class in MacApp 3 (which, by the way, is a wonderful improvement!). It doesn't replace any individual object from MacApp 2. Instead, by allowing "dialog-ness" to be attached to any window, it eliminates the need for TDialogViews. The code change to truly implement TDialogBehaviors involves removing TDialogViews. The fact that a new architecture doesn't simply involve a one-for-one replacement doesn't mean that there's a problem: it simply means that you have to evaluate more issues.

In the case of TDialogBehavior, the removal of TDialogViews affects resources, and often ripples through your application, since TDialogView almost always was overridden. In a data-entry intensive MacApp 2 application, it was easy to come up with half a dozen overrides of TDialogViews. All of these classes would need to be removed, and their function-alities correctly distributed.

After evaluating the scope of the changes, you need to find something for the other side of the balance: what benefits would adoption of this architecture provide?

Does it Save Code?

We have converted a number of programs from MacApp 1.1 to MacApp 2, and others from MacApp 2 to MacApp 3. In each case (but particularly in the latter case) we have found that the converted application code was shorter than the previous version. The reason isn't hard to find. As people use the framework, many people find themselves bumping up against limits and problems. Through a forum like MacAppTech$, the development teams watch and listen. When a number of people have the same problems, a new framework or new version of an old framework is likely to incorporate not only bug fixes but framework level solutions to frequently-asked questions and common problems.

Going back to the summer of 1990, you would discover that a hot topic in FrameWorks and on MacAppTech$ was "What is My TDocument?" In MacApp 2, the TDocument was the object which contained data, which could be dirtied, which could write to a file, and which could display itself in windows. People started to have problems with documents that weren't file based (database applications) or documents that lived in several files. Lo and behold, the MacApp architecture for version 3 cut the Gordian knot of TDocument, giving us TDocuments, TFiles, TFileHandlers, and dependencies for good measure. People (like us) who had contorted databases into TDocuments found that we could make what had been a descendant of TDocument into a descendant of TObject (smaller, faster, simpler) and handle its dirtying with dependencies. Similarly, applications with multiple-file documents were able to simplify their file handling with the new structure.

In these cases, adoption of the new architectures means removing special-case code from an application and either totally on the framework for doing the task, or overriding a much smaller and more specific method of the framework. The work is pushed into the framework (good) and out of the application (good).

In the case of TDialogBehaviors, cited above, the removal of TDialogViews and their application-specific descendants also generally means a net code saving.

The virtue of saving code isn't always evident to some people. After all, we are taking something that's not broken and fixing it (TDialogViews can still be used in MacApp 3). The advantages of saving code are these:

  • Shorter compile/link cycles.
  • Easier maintenance (removing entire classes can mean removing entire files from a project).
  • Eliminating old architectures can simplify staffing requirements: there are many "horror stories" of systems that are hard to maintain because they've got one section still written in SNOBOL or PL/1.
  • Relying on a framework to provide functionality may increase the likelihood of that functionality being maintained across new system software releases. (This is a hot issue right now; in the long term, there's no doubt that this is true. Equally true is that in any given short term, it's sometimes true and sometimes not.)

What is its Life Expectancy?

Once you have evaluated the extent of the changes required to an application by the incorporation of a new architecture, and balanced them against the savings in code that can be achieved, the problem is not yet solved.

Some wonderful ideas come and go–far too soon. In evaluating an architecture's life expectancy, technical expertise seems to be less important than a knowledge of the Tarot. Yet, it's not all mysterious.

Take as an example a small office of a dozen people with a low level of computer literacy. Everyone knows Microsoft Word. On a few occasions a year, they need to incorporate pictures into documents. What would you recommend?

  1. Do it with rubber cement the way they do it now-and the way they did it in the 1950's.
  2. Buy a scanner and master Word's graphics commands.
  3. Buy a scanner and Quark.

The correct answer, of course, is A. And it's correct not because of the low volume of work, it's correct because with OpenDoc and OLE 2.0 it's reasonable to assume that the way in which graphics are incorporated into documents a year from now will differ substantially from the way in which we do it now-with any application. Now is the wrong time for a user who can afford to wait to invest in any existing application for this purpose, just as by reading the trade and financial pages you could find out that buying a color printer was probably a poor investment until this year.

Often programmers, designers and system architects look down their noses at this kind of analysis-after all, it's not technical. But, to a large extent, this type of analysis is crucial to deciding what new architectures to adopt, which to ignore, and which to watch.

A further example is that of TBehaviors. For a MacApp user who is not using TBehaviors, the decision to include them in new or existing applications might well be influenced not only by the intrinsic value of TBehaviors, but also by noting that they are present in the interfaces to a new framework.

incorporating new architectures

Laying Out the Ground Rules

Once new architectures are selected for a project, it is essential that ground rules be laid out. When we first started using TBehaviors, we used them in very limited ways. Now we have no rules about their use-save that they should be used if at all possible to avoid overrides of TView and its descendants.

TAdorners, another powerful feature of MacApp 3, also can help eliminate overrides of TView. TAdorners are a little trickier to implement than TBehaviors, because they require the under-lying views to make certain assumptions (since frame adorners are drawn within views, views which might have frame adorners added to them cannot draw to their edges in all cases).

In some cases, such as the use of the dependency mechanism in MacApp 3, the ground rules take the opposite approach. The dependency mechanism is a wonderful feature of MacApp 3, improving over the mostly idiosyncratic mechanisms that were added for each application in MacApp 2. However, the dependency mechanism can break very easily if it is not used in all cases in an application. So with regard to the dependency mechanism, our ground rule from the start has been: only the dependency mechanism can be used to communicate changes between and among objects.

Taking some time at the beginning to establish the parameters under which new architectures will be used pays off. A particular benefit is that in order to establish these parameters, it is important to truly understand the new architecture and how it relates to the known framework.

Breaking an Application

In the case of a conversion, incorporating new architectures frequently means "breaking" the existing application for a while. Replacing TDialogViews with TDialogBehaviors (or descendants thereof) can take a significant amount of time. Normally, we work with relatively small code-compile-test cycles. Breaking an application for a period of weeks runs the risk that when it is finally put back together again it won't compile for quite some time, or that when it is put back together again it won't work properly.

There is no one simple answer to this problem. One thing that can help is to compile new objects with new architectures in stand-alone applications to test their functionality. Particularly since a new architecture may be new to programmers and so be more bug-prone, this route may save time in the long run. In this strategy, instead of breaking the old application, it is simply put aside, and the new objects developed on their own. Then, when the old application is "broken" what is put in is not new code, but entire new objects which have been tested on their own.

A further help at this stage is to rely strongly on Projector (or another such tool). If the original application is "frozen" (i.e., all files checked in, read-only), the changes can be made in modifiable branches that can all be discarded if necessary to return to the status quo ante.

Testing, Documentation, and Support

New architectures challenge all members of a project team, and should be discussed and explained to everyone. Support staff who are used to fielding help calls from users "trapped" in a modal dialog need to start working-themselves-with software that features movable modal dialogs with menu access.

Many of the new architectures discussed here (TBehaviors, TAdorners, dependency mechanism, TDocument/TFileHandler/TFile structure) have the effect of moving code from the application back into the framework. Applications override smaller objects with fewer methods. Documentation procedures designed for applications with 50 overrides of TView and its descendants may need to be reviewed when those overrides all are implementations of TBehaviors.

DO I HAVE TO?

Oddly enough, programmers are remarkably conservative. If you follow the MacApp3Tech$ traffic, you can see that people are writing programs using MacApp 2 architectures-and even earlier, non-object-oriented architectures! By picking the architectures of that will withstand the test of time, within any of the major frameworks, applications can be made as sturdy, as efficient, and as maintainable as possible.
 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Recruit two powerful-sounding students t...
I am a fan of anime, and I hear about a lot that comes through, but one that escaped my attention until now is A Certain Scientific Railgun T, and that name is very enticing. If it's new to you too, then players of Blue Archive can get a hands-on... | Read more »
Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »

Price Scanner via MacPrices.net

May 2024 Apple Education discounts on MacBook...
If you’re a student, teacher, or staff member at any educational institution, you can use your .edu email address when ordering at Apple Education to take up to $300 off the purchase of a new MacBook... Read more
Clearance 16-inch M2 Pro MacBook Pros in stoc...
Apple has clearance 16″ M2 Pro MacBook Pros available in their Certified Refurbished store starting at $2049 and ranging up to $450 off original MSRP. Each model features a new outer case, shipping... Read more
Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more

Jobs Board

Liquor Stock Clerk - S. *Apple* St. - Idaho...
Liquor Stock Clerk - S. Apple St. Boise Posting Begin Date: 2023/10/10 Posting End Date: 2024/10/14 Category: Retail Sub Category: Customer Service Work Type: Part Read more
*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL Read more
Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.