473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Design dilemma...

Hi all,

Not sure if this is the most appropriate place for this so apologies if
inappropriate...

I have come back to a framework I built some time ago to see where some
refactoring can take place to improve performance, and following some test
have highlighted a few areas where some changes would definitely benefit the
application.

I have however come to a point where there are two ways to make the change
and I wanted some objective input to help me decide what is the better way.

My app is split into the classic three tiers, Backend, Business and
Frontend. Using the template pattern, abstract methods are called from base
classes which build a list of business objects from the database given a
search criteria. Each business object has its own set of fields all of
varying types, i.e. String, Float, Integer, DateTime.

The original setup called an abstract method in the chosen backend object,
say for this example we have an Activity business object, so a corresponding
backend object exists as does a Config Activity front end object.

Assuming a wild card search criteria an activity list could be generated, so
as each 'row' was read from the database it created a new Activity business
object, and called a method on the Activity backend object to transfer the
data to each field in the Activity business object. This proved time
consuming performance wise as some of the objects had many fields, so took a
while to be populated.

I changed this a while back so that in the base business object class there
was a string list which held the data for each field and had an enumerated
type which facililated access to the data for viewing purposes on a grid for
selection, and then when the User chose an actual Activity from the result
set list then there was no real need to have the field values in their
native type.

I have now realised that in certain areas where lists of business objects in
their native type are being generated the performance is appalling, so
looking back into the framework I see that the same problem is present, i.e.
the time to populate native type fields is time consuming and similarly the
only real time that one needs the data in native type is at the point of
Edit/Config.

So I figured that I would keep the native type fields for each business
object, and then have an abstract method that would 'PopulateObjectToType'
when the User chose to edit this field. But then I thought well shouldn't
it really be properties that simply provide the native type field when
required, so now my dilemma is which to go for, the overall Population at an
appropriate time OR simply pull the values to a native type when required.
But THEN I thought well what is the point of having the native type fields
in the business objects at all, why not just have them held in a list of
strings and read from and write to them which makes it all sound far simpler
to maintain, as in the original two options I see there being a potential
for duplication of data, and hence potential for data loss.

So what do people think about this, assuming they haven't lost the will to
live at this point?

Many thanks for any input on this...
Colin B
Nov 15 '05 #1
0 1188

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: TheFerryman | last post by:
Hi, I keep running up against the same design problem. Let's say I have a cat object like this: //-----------------------------------------------------------------------------------------...
7
by: bartek | last post by:
Hello, I've been pondering with this for quite some time now, and finally decided to ask here for suggestions. I'm kind of confused, actually... Maybe I'm thinking too much... Brain dump...
7
by: Susan Bricker | last post by:
Greetings. As a relative newcomer to Access, I am having trouble deciding on how to design the form flow for updating and creating related records. I'm looking for a variety of suggestions so...
1
by: PCC | last post by:
I am writing a data access layer for a web service. Data from the web service is to be returned as XML. My design dilemma is this... Should I be returning XML from my stored procedures using...
3
by: reageer | last post by:
Hi all, I have a design question: I have a bunch of users (name, address, zip, etc.). They are assigned a card with a specific id. The only thing unique is this card id, or probably the...
14
by: ApexData | last post by:
In my database, I uniformly handle records on a Record by Record basis, in a single form that contains New/Edit/Del buttons. Because I'm dealing with records one at a time, I can easily manage my...
10
code green
by: code green | last post by:
I wasn't sure what title to give this, or whether I can explain my dilemma, but here goes. My company sells products that are inter-compatible with each other, mainly four ranges I will call...
2
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi, I'm wondering if anyone can give me any ideas/good practice/advice. I've got a web form which a user inputs lots of data into, then presses submit. The submit button uses two classes to input...
3
by: DerrickH | last post by:
I have a template class with three policies: PolicyA, PolicyB, and PolicyC. The design dilemma I am having is that B and C depend upon A, but I would like my Host class to derive from all three. In...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.