473,395 Members | 1,815 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,395 software developers and data experts.

Customizing methods with different queries but same logic

Hi All,

I've a C# application which reads data from AS400. In this application I've written nearly some 20 methods to read data from different tables do some calculations and fill up customized collections. Till its fine.

Now we are adding one more new functionality in to our system. The system has to check the type of functionality (old or new) then proceed accordingly.

For this new functionality also we have to read data from the same set of tables and do the same calculations and fill up the same collections. But the only one different is the SELECT queries used for this new functionality will be different.

I don't want to check the funtionality type in all the methods and use queries accordingly.

How easily we can customize this ? (in future we may add some more new functionality too)

Please advice..

Regards,
DHARMA.R
Nov 8 '07 #1
3 868
r035198x
13,262 8TB
Hi All,

I've a C# application which reads data from AS400. In this application I've written nearly some 20 methods to read data from different tables do some calculations and fill up customized collections. Till its fine.

Now we are adding one more new functionality in to our system. The system has to check the type of functionality (old or new) then proceed accordingly.

For this new functionality also we have to read data from the same set of tables and do the same calculations and fill up the same collections. But the only one different is the SELECT queries used for this new functionality will be different.

I don't want to check the funtionality type in all the methods and use queries accordingly.

How easily we can customize this ? (in future we may add some more new functionality too)

Please advice..

Regards,
DHARMA.R
Perhaps you did not design the application well initially.
If you had created a DB class that has generic methods for accepting queries as strings and returning the results then adding support for new queries is the same as simply calling the DB class' methods with a different string as a parameter.
Nov 8 '07 #2
Perhaps you did not design the application well initially.
If you had created a DB class that has generic methods for accepting queries as strings and returning the results then adding support for new queries is the same as simply calling the DB class' methods with a different string as a parameter.
Hi,

Thanks for the comment.

Actually the system is running for decades and we are to change it now. :-)
Is creating a DB class a only way to solve this issue ?

Regards,
DHARMA.R
Nov 8 '07 #3
r035198x
13,262 8TB
Hi,

Thanks for the comment.

Actually the system is running for decades and we are to change it now. :-)
Is creating a DB class a only way to solve this issue ?

Regards,
DHARMA.R

If you want flexibility on the queries that can be executed by the application and require minimal code changes when new queries are introduced then a DB class accepting strings and performing the queries and connections would solve the problem.
Perhaps I'm not getting your question ...
Nov 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

32
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
6
by: John Rivers | last post by:
hi, here is how to do it and restore sanity to aspx html rendering: (please only reply with sensible architectural discussion - juan) put this at the end of an aspx file (or use an include at...
24
by: clare at snyder.on.ca | last post by:
I have a SQL query I need to design to select name and email addresses for policies that are due and not renewed in a given time period. The problem is, the database keeps the information for every...
3
by: Michael Maes | last post by:
Hi, We have a windows service passing objects to a client application by remoting. The windows service is started and running successfully. * When the client app is running on the same...
26
by: Cliff Williams | last post by:
Can someone explain the pros/cons of these different ways of creating a class? // 1 function myclass() { this.foo1 = function() {...} } // 2a
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to create a customized ComboBox where the methods ComboBox.Items.Add and ComboBox.Items.Insert will behave thusly: -- If the item is not present, add it. -- If the item is present, set the...
4
by: dan655t | last post by:
Hello, I've come here to get some advise from the experts. Currently I am tasked with modifying a web service that currently supports one product to support multiple products. It needs to be...
10
by: r035198x | last post by:
The Object class has five non final methods namely equals, hashCode, toString, clone, and finalize. These were designed to be overridden according to specific general contracts. Other classes that...
5
by: Andy B | last post by:
I was just wondering, when you create dataContext methods, should you put business logic there to try and minimize pushing data through 2-3 layers of code? or should the business logic still go in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.