This is not a direct answer to your question but i don't know all your requirements.
Also keep in mind that using/creating a class that does all the magic is a good (or the best) way to re-use and, more important, maintain your code/businesslogic. It helps you to have a good marriage between "your app" and "the future" ;-)
Good that you say you want to do all those things as soon as possible in the flow. If you put the data provided by the client in your object, which handles all the formatting you need further on, straight away, you'll have a solid structure to handle that data in a consistant and clear way. Also future extensions or adaptations to your code are to be done only in that class.
I know, its a bit the same as my previous post but it is verry important to write code that is easy to use and maintain. The main things to do are:
1. write the code only once (so in one place (class))
2. make shure that your class has the least responsability as possible (in your case accept a string and provide methods to read/write data from/to that string).
3. use meaningful words as variable and methods
4. take enough time to document all your code. This is the part that most people skip to write as much "code" as possible.
That is what makes future maintenance faster and easyer to do. Ever had to maintain or use code someone else wrote without documentation and using carppy namings? Where the code was spread all over the place because it was faster to implement (write) it that way? Guess who is the black sheep if time passes and results stay out! Not the one who wrote it fast, crappy and without any documentation (and was lucky it all, kind of, worked). Crazy, i know, but the hard reallity.
But often its because there is a lot to do and learn and little time to do it all.
Good luck.
Subject: Re: [Caché] Re: [2009.1] $list questions: Best/optimal ways to remove empty list items and how to reverse?
|
From: Micky Hulse
Sent: Sunday, July 7, 2013 3:28 PM
To: intersystems. public. cache |
Reply To: intersystems...@googlegroups.com
Subject: Re: [Caché] Re: [2009.1] $list questions: Best/optimal ways to remove empty list items and how to reverse?
|