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

how best to represent this?

Ok, concerning my little pet project...I have int arrays of the
following sizes:

panel[][,]
AND
panel[][][,]

They are static fields right now, and I'm wondering if it's possible
(and better) to make them separate classes/objects of type Panel.

First off, here's the information for the object:

There are four panels (represented by the first index with values 0-3).
There are eight switches on each panel (second index, 0-7).
Each switch controls twenty lights that may or may not turn on (third
index ranging from [0,0] to [1,9]).

So, my questions:
1. If I make this an object rather than a static field, should it be a
struct or class? It's integers, but I'm guessing the fact that it's an
array means it's a class.

2. Should it inherit from ArrayList?

3. How do represent the index values when making a class? Can you create
complex indexers like [][][,]?

4. Is it possible to create properties like this:

panel.SecondPanel.ThirdSwitch.FifthLight?

If so, how do I define those properties so that they return the proper
value?

One thought is that the static field gets moved to the Panel class, and
the class works with it internally, but I still don't know how to
implement all this.

Thanks.
Nov 21 '05 #1
1 1142
If this is .NET 2.0, you could create a generic List of
panel classes.

You could also have each panel contain child panels.

I'm not 100% of the flexibility requirements and
how you are utilizing a panel.

--
Robbe Morris - 2004/2005 Microsoft MVP C#
http://www.masterado.net

"John Salerno" <jo******@NOSPAMgmail.com> wrote in message
news:uY********************@rcn.net...
Ok, concerning my little pet project...I have int arrays of the following
sizes:

panel[][,]
AND
panel[][][,]

They are static fields right now, and I'm wondering if it's possible (and
better) to make them separate classes/objects of type Panel.

First off, here's the information for the object:

There are four panels (represented by the first index with values 0-3).
There are eight switches on each panel (second index, 0-7).
Each switch controls twenty lights that may or may not turn on (third
index ranging from [0,0] to [1,9]).

So, my questions:
1. If I make this an object rather than a static field, should it be a
struct or class? It's integers, but I'm guessing the fact that it's an
array means it's a class.

2. Should it inherit from ArrayList?

3. How do represent the index values when making a class? Can you create
complex indexers like [][][,]?

4. Is it possible to create properties like this:

panel.SecondPanel.ThirdSwitch.FifthLight?

If so, how do I define those properties so that they return the proper
value?

One thought is that the static field gets moved to the Panel class, and
the class works with it internally, but I still don't know how to
implement all this.

Thanks.

Nov 21 '05 #2

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

Similar topics

52
by: Andy Dingley | last post by:
I'm using this at present: <p title="Publication date" ></p> Works fine on screen, but Fangs/Jaws just reads it as "left bracket twenty-eight slash zero slash two thousand five fifteen colon...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
9
by: Frances | last post by:
Hi All, * PREMISE * I'm creating an Access form with 150 items subdivided into 20 categories. Multiple categories (and items) can be selected so my user wants checkboxes. All of the options...
3
by: Jose Fernandez | last post by:
Hello friends. I was searching on Amazon for a Object Oriented Programming book but I found so many many of them. Could you help me by telling me a the best in your opinion?? My target is to...
14
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
3
by: Nick | last post by:
I'm looking for any guidelines along the lines of XSD Best practices for the following issues. If you are modelling something like interest rates, there is a choice of how you represent that...
4
by: MicroMoth | last post by:
Hi, I'm trying to write a update method, in which when the user clicks the update button the update method is passed 10 form fields. Then a update SQL is run to update the database. My question...
0
by: Rick Shaw | last post by:
Hi, I have a table column that can contain 3 values, 'Y', 'N' or '' (blank). What is the best way to represent this on the winform? With radio button, there is no easy way to do the databinding. ...
1
by: steve | last post by:
Hi, I am working on a finite-volume numerical method project. I am not great at programming though. I am looking for the best way to represent this grid in C. The grid consists of N points spaced...
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: 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
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.