473,669 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1230
You have COM+ readily accessible under .NET (see System.Enterpri seServices).
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
--

"trinitypet e" <tr*********@on line.nospam> a écrit dans le message de
news:74******** *************** ***********@mic rosoft.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
8014
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 in "Learning Python" by Mark Lutz and David Ascher. It seems like they are a relatively new feature... It seems to me that any truly OO programming language should support these so I'm sure that Python is no exception, but how can these be...
3
2088
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 copy of data as opposed to multiple instances of the class) C# is now applying the static concept to methods. Why?, I thought that only one copy of the methods were loaded into memory not matter how many instances were created. Is this different...
2
2655
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 following type : Exception, Error, Warning, Infos (with differents colors, etc). I would like to use it like the Console.WriteLine("My Message"); on everywhere in my application.
11
3818
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 experts. I would like to produce Javascript classes that can be "subclassed" with certain behaviors defined at subclass time. There are plenty of ways to do this through prototyping and other techniques, but these behaviors need to be static and...
8
2620
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 Object(); ...// some codes
12
3572
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
9911
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
20764
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 & I don't want to copy + paste code. How can I inherit those member variables? Thanks
4
4520
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 child apps of an IIS application and can be used by multiple users during the application life cycle and for multiple page loads for the same or different page under a root application. What I don't understand and need to know is whether that...
5
2654
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 method is not allowed. How do you do this if you really need a static class but also have to use these instance objects in them? If you need a simple example of what I am trying to do, it is below: imports Data.EternityRecordsEntities namespace...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8588
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.