M
mp
Hi all,
starting an app with an input form with 3 textboxes
length, width, depth (representing dimensions of a block of stone)
and a command button "calculate"
calculate will take the 3 entries and fill in variables representing sizes
of other objects
the objects are sides/ends/bottoms of a box whose interior dimensions would
contain the original values length,width,depth
my first iteration was just put variables in the form / do calculations /
process results
on second thought, it would be more OO to make a class representing the
original variables perhaps
and another class representing the resultant parts - or even one class per
part??? (side / end / bottom / etc)
below are the vars using just the form
how should i change this to make multiple classes - each holding it's
respective values?
do i create a new .cs file for each object or just define classes within the
form .cs?
any other advice on class structures(patterns?) in a simple scenario like
this?
I've seen multiple classes defined in one .cs file but coming from vb6 it's
foreign to me and not sure how that would be structured.
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//original variables
private double m_dStoneWidth =0;
private double m_dStoneLength =0;
private double m_dStoneDepth =0;
//resultant variables to be calculated
private double m_dBaseLinerWidth = 0;
private double m_dBaseLinerLength = 0;
private double m_dBaseShellWidth = 0;
private double m_dBaseShellLength = 0;
private double m_dSideLinerWidth = 0;
private double m_dSideLinerLength = 0;
private double m_dSideShellWidth = 0;
private double m_dSideShellLength = 0;
private double m_dEndLinerWidth = 0;
private double m_dEndLinerLength = 0;
private double m_dEndShellWidth = 0;
private double m_dEndShellLength = 0;
thanks for any info or sites that might help me get started.
Mark
starting an app with an input form with 3 textboxes
length, width, depth (representing dimensions of a block of stone)
and a command button "calculate"
calculate will take the 3 entries and fill in variables representing sizes
of other objects
the objects are sides/ends/bottoms of a box whose interior dimensions would
contain the original values length,width,depth
my first iteration was just put variables in the form / do calculations /
process results
on second thought, it would be more OO to make a class representing the
original variables perhaps
and another class representing the resultant parts - or even one class per
part??? (side / end / bottom / etc)
below are the vars using just the form
how should i change this to make multiple classes - each holding it's
respective values?
do i create a new .cs file for each object or just define classes within the
form .cs?
any other advice on class structures(patterns?) in a simple scenario like
this?
I've seen multiple classes defined in one .cs file but coming from vb6 it's
foreign to me and not sure how that would be structured.
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//original variables
private double m_dStoneWidth =0;
private double m_dStoneLength =0;
private double m_dStoneDepth =0;
//resultant variables to be calculated
private double m_dBaseLinerWidth = 0;
private double m_dBaseLinerLength = 0;
private double m_dBaseShellWidth = 0;
private double m_dBaseShellLength = 0;
private double m_dSideLinerWidth = 0;
private double m_dSideLinerLength = 0;
private double m_dSideShellWidth = 0;
private double m_dSideShellLength = 0;
private double m_dEndLinerWidth = 0;
private double m_dEndLinerLength = 0;
private double m_dEndShellWidth = 0;
private double m_dEndShellLength = 0;
thanks for any info or sites that might help me get started.
Mark