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

Static v's instance v's COM

Hi all,

Here is a question that I have been trying to work out - hopefully someone
will be able to give me a few pointers.

I often end up in a quandary deciding if a class should be static/instance
and/or if it should be hosted under COM (mainly with performance in mind).
Can any one point me to any resources that may help.

ie. Data Access Class - just retrieving requested dataset - No state
required, so implemented as static.

If this Data Access Class has a huge number of requests, would there be any
performance benefit in making instance and deploying in COM services. My
understanding is that deploying a static class under com has no benefits as
it cant participate in object pooling etc.

Guess you can see where I am going with this question - designing for
performance.

Pete.
Jul 21 '05 #1
2 1217
You have COM+ readily accessible under .NET (see System.EnterpriseServices).
AFAIK you should never have to do something under COM just for the sake of
performance.

IMO it's best to design first the simplest, cleanest architecture that works
and then identify possible bottlenecks. Generally performance problems are
not where you though before writing the code.

Patrice
--

"trinitypete" <tr*********@online.nospam> a écrit dans le message de
news:74**********************************@microsof t.com...
Hi all,

Here is a question that I have been trying to work out - hopefully someone
will be able to give me a few pointers.

I often end up in a quandary deciding if a class should be static/instance
and/or if it should be hosted under COM (mainly with performance in mind).
Can any one point me to any resources that may help.

ie. Data Access Class - just retrieving requested dataset - No state
required, so implemented as static.

If this Data Access Class has a huge number of requests, would there be any performance benefit in making instance and deploying in COM services. My
understanding is that deploying a static class under com has no benefits as it cant participate in object pooling etc.

Guess you can see where I am going with this question - designing for
performance.

Pete.

Jul 21 '05 #2

Do you mean making it a singleton?

trinitypete wrote:
Hi all,

Here is a question that I have been trying to work out - hopefully someone
will be able to give me a few pointers.

I often end up in a quandary deciding if a class should be static/instance
and/or if it should be hosted under COM (mainly with performance in mind).
Can any one point me to any resources that may help.

ie. Data Access Class - just retrieving requested dataset - No state
required, so implemented as static.

If this Data Access Class has a huge number of requests, would there be any
performance benefit in making instance and deploying in COM services. My
understanding is that deploying a static class under com has no benefits as
it cant participate in object pooling etc.

Guess you can see where I am going with this question - designing for
performance.

Pete.

Jul 21 '05 #3

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

Similar topics

4
by: Neil Zanella | last post by:
Hello, I would like to know whether it is possible to define static class methods and data members in Python (similar to the way it can be done in C++ or Java). These do not seem to be mentioned...
3
by: Jay | last post by:
Why are there static methods in C#. In C++ static was applied to data only (I believe) and it meant that the static piece of data was not a part of the object but only a part of the class (one...
2
by: superseed | last post by:
Hi, I'm pretty new to C#, and I'm quite stuck on the following problem. I would like to add to my application a Windows.Form (singleton) on which I could display a message of one of the...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
8
by: nytimescnn | last post by:
I've read some discuession about lock() for thread-safe. I am wondering what will be the differce between below two code segment? Code 1: class A { private static Object padlock = new...
12
by: chandu | last post by:
hello, i want to know usage of static methods in a class. is it advantageous or disadvantage to use more static methods in a class. thank u
14
by: Jordan Marr | last post by:
I have the following class: class ProvisionCollection { ... private int m_VarianceCount; public int VarianceCount { get { return m_VarianceCount; }
13
by: learning | last post by:
Hi I have a static class written by other team which encapsulates a database instance. but I need to extend it to incldue other things. I know that C# static class is sealed and can;t be inherited...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
5
by: Andy B | last post by:
I have a class that I want to make static but it uses some objects that are instance objects. I keep getting a compiler error saying something about using instance objects in a static class or...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.