473,320 Members | 2,071 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,320 software developers and data experts.

Design and Deployment of C# Programs

Hi All,

I am new to C# and I am facing a problem with respect to design and deployment of C# program.

My application needs the following:
a) A console program will do some data processing and will store the results in a static variable in Singleton class.
[Imagine the logic like this - This program takes the list of absent employees and find their emailids from a database and store the emailids in a static variable in Singleton class.
Once this is done, the console program starts a timer program. The timer program will take the emailid from the static variable and sends email to those employees once in every one hour - "Are you coming to office or not?"]

b) A GUI program will have one button and on clicking the button, it will access the same static variable in Singleton class.
[
Imagine the logic like this - This GUI allows an administrator to enter an email id in a textbox. Then, the administrator will click the "Add" button. Then, this emailid will be added to the existing list of emailids in the static variable in same Singleton Class.
So, my timer program in (a) will consider this newly added emailid too, when it sends email in the next hour.
]

I am facing the following problem when I try to develop the same. I am not able to access the same static memory variable from GUI program.

In java (if it is a web-based application), we deploy the application in a server and the static variable will be held in memory by the server. So, whichever client request for the variable, server will ensure that it gives the same variable to all. But, I dont know how to do it in C#.

I am using Visucal C# Express Edtion (as of now) for development. I develop it as a project in this IDE under a solution. I am also unable to bring these two programs into a single project. It is because, both of my programs need a Main() method.

Can someone help me out? How to bring these two programs together to access same variable? Thanks.......

Kindly let me know if anymore details are required.

Regards,
Desigan

Note: I request you not to validate the logic of my example. It is not my requirement, but mimics the problem that I am facing.
Sep 8 '06 #1
2 2381
Maybe I'm not understanding, but if you declare the singleton class as a global variable wouldn't that make all of its properties globally accessible?

Singleton o;
private void()
{
o = new Singleton;
o.LocalVariable = AllAbsentPeople;
}
private AddUser()
{
o.LocalVariable = AllAbsentPeople + NewAbsentPerson
}


Recently I've only been programming in VB.net so you'll have to excuse my syntax.

Paul
Sep 10 '06 #2
Hi,

Thanks for the reply.

This is the problem that I face in short. I have a singleton class and in that there is a global variable. Of course (as you mentioned), this variable is accessible by any classes.

Now, my application has
- a console application that updates this variable
- a GUI which also update the same variable

Now, console application works fine. Say, it has updated some value in that global variable. Now, when we run the GUI it does not consider the same variable. Instead it has its own copy of global variable. It behaves as if the program is run from a different runtime. But, I am running it from the same runtime.

Regards,
Desigan
Sep 11 '06 #3

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

Similar topics

2
by: ksskumar | last post by:
Hi Friends, My software's target is to creating a add-in for Outlook. I am struckup of creating deployment of my software. My software flow is as follows, 1. Complete functionality is...
2
by: David | last post by:
Everyone, Windows 2000/XP ..NET Framework 1.1 ..NET Development Environment 2003 I am having an issue with the .NET deployment wizard. I go and setup the Add/Remove programs icon in my...
1
by: RK | last post by:
Hi I am having this problem with my deployment project. 'Another version of this product is already installed. Installtion of this version cannot continue. Configure or remove existing version...
1
by: lizii | last post by:
At the moment my company have asked me to look into installations. We use pure .NET applications and although i have looked into installer programs (installshield...wise..etc) none of them are...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
3
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I use ADO connection to connect DB, when build/run, it generates interop.ADODB.dll and appName.exe, I want to use only .exe to deployment this window app, so how to put the .dll file...
6
by: andrewbb | last post by:
I want to deploy a service with a windows app and the setup program must conform to the Vista certification requirements. Can that be done with the standard .net setup project? Assuming cost is...
2
by: Miro | last post by:
Reading the help file it says in step 2 to click on "other project types" and then click on "Setup and Deployment projects".( see below ) I am using vb2005 express. Im assuming this is not an...
11
by: JFB | last post by:
Hi All, I have done my little vb.net 2005 app, it includes a dll as reference. How can I deploy my app? How can I include my dll? Thanks JFB
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.