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

Small Application Structure Help

After reading Extreme Programming adventures I am starting to think
more about the design of my applications. I was wondering how I would
structure a new, small VB or C#.NET Windows application.

Instead of calling a startup form I was thinking of calling a class
named after the application with a shared Sub Main and a shared member of
type ApplicationCommand. The Main routine would Application.Run the
Startup form. The startup form and all forms called from the startup form
would have access the the shared member ApplicationCommand that would
contain all the methods necessary to get the information they wanted
(ie: GetCustomerList, GetProductList, GetOrder.)

I was wondering if this is a good or bad design for a small to medium
size business app. I am not sure
anymore. I feel lost.
Questions, questions... hopefully some answers will follow.

Thanks,
CodeMonk
Nov 21 '05 #1
3 994
"codemonk" <co******@verizon.net> wrote in news:#hYdmCXpEHA.3392
@TK2MSFTNGP15.phx.gbl:
The startup form and all forms called from the startup form
would have access the the shared member ApplicationCommand that would
contain all the methods necessary to get the information they wanted
(ie: GetCustomerList, GetProductList, GetOrder.)

I was wondering if this is a good or bad design for a small to medium
size business app. I am not sure
anymore. I feel lost.


I think it's a bad idea...

Your Application Class will get bloated really quickly and contain
hundreds of methods if your application grows large.

Rather, create several objects in your application such as:

Customer
GetCustomerList Function
AddCustomer Function
DeleteCustomer
etc.
etc.
Product
AddProduct
DeleteProduct
Order
OrderID Property
OrderInfo Property as DataTable?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #2
Thanks for your advice. Now with that solution do I have to have members to
Customer, Product, Order, etc in each form? Do they stay alive for the life
of the form or are they created and destroyed after being called from the
form's event handler?

Which makes me also wonder about form to form communication. Does one form
call another form directly or whould you use some broker object?

Thanks again for your prompt and wise help,
Codemonk

"Lucas Tam" <RE********@rogers.com> wrote in message
news:Xn***************************@140.99.99.130.. .
"codemonk" <co******@verizon.net> wrote in news:#hYdmCXpEHA.3392
@TK2MSFTNGP15.phx.gbl:
The startup form and all forms called from the startup form
would have access the the shared member ApplicationCommand that would
contain all the methods necessary to get the information they wanted
(ie: GetCustomerList, GetProductList, GetOrder.)

I was wondering if this is a good or bad design for a small to medium
size business app. I am not sure
anymore. I feel lost.


I think it's a bad idea...

Your Application Class will get bloated really quickly and contain
hundreds of methods if your application grows large.

Rather, create several objects in your application such as:

Customer
GetCustomerList Function
AddCustomer Function
DeleteCustomer
etc.
etc.
Product
AddProduct
DeleteProduct
Order
OrderID Property
OrderInfo Property as DataTable?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 21 '05 #3
"codemonk" <co******@verizon.net> wrote in
news:ei**************@tk2msftngp13.phx.gbl:
Thanks for your advice. Now with that solution do I have to have
members to Customer, Product, Order, etc in each form? Do they stay
alive for the life of the form or are they created and destroyed after
being called from the form's event handler?


It's up to you. You can place the objects in your Main Application form so
you don't have to create them on each for. OR, you can create these objects
on a perform basis, or you might mix and match (i.e. Product Object is in
the Main Form and shared by all objects).

To communicate between forms, either pass a reference to the form, or
declare public form properties, or you can go through a broker object.

Using a reference or public properties is probably easier.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #4

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

Similar topics

24
by: Salad | last post by:
Every now and then I see ads that state something like "Experience with Large Databases ...multi-gig...blah-de-blah" And I have to laugh. What's the difference between a large or small database? ...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
6
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application...
1
by: Christopher A. Kelly | last post by:
I need to figure out how to control any 3rd party application by simulating mouse click and key presses. I need to take a partial window title and get the handle then be able to send the necessary...
17
by: John A Grandy | last post by:
For a Hashtable that is expected to contain no more than 100 DictionaryEntry elements , what is the best load factor ? ( This Hashtable is a encapsulted in a class , an instance of which is...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
35
by: salad | last post by:
I have an application written in MS-Access. It is a complete application that manages the day-to-day operations of a business. The program is nearly ready to be used in other customer sites. ...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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...
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...

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.