Please help me to design.

S

shuisheng

Dear All,

I want to develop an engine library for a particular purpose such as a
physical phenomenon simulation. The input is the required physical data
and geometry. The output is the simulation results. Also some
postprocessing are required on the results.

I have a rough design like this:

Three classes: CInterface, CEngine, CPostprocessing

CInterface records all the input data and output results. So it can
provide input to the CEngine, and sace the sumulation results from
CEngine.

Postprocessing is worked on sumulation results.

I am new to software design. I think this may be too naive. Any good
advice or other things I need to consider in the design.

Thank you for your kind help!

Shuisheng
 
P

Phlip

shuisheng said:
I have a rough design like this:

Three classes: CInterface, CEngine, CPostprocessing
I am new to software design.

Write the simplest design you can think of. It may include these three
objects, so long as each has simple behavior.

Use a unit test rig ( such as the one at
http://unittest-cpp.sourceforge.net/ ), and write test cases. Each case will
spark up your objects, and send sample data through them.

As you think of more complex data to send, write more test cases. If any
fail, upgrade the code to pass the test.

One myth of software design is you must design your program, implement the
design as source code, and then never change it. That myth comes from
programmers who don't write unit tests for their code. If you instead write
unit tests, you can refactor the design as you go. It may get more complex
than your first plan, or less. But it will never get hard to change!
 
T

Thomas Matthews

shuisheng said:
Dear All,

I want to develop an engine library for a particular purpose such as a
physical phenomenon simulation. The input is the required physical data
and geometry. The output is the simulation results. Also some
postprocessing are required on the results.

I have a rough design like this:

Three classes: CInterface, CEngine, CPostprocessing

CInterface records all the input data and output results. So it can
provide input to the CEngine, and sace the sumulation results from
CEngine.

Postprocessing is worked on sumulation results.

I am new to software design. I think this may be too naive. Any good
advice or other things I need to consider in the design.

Thank you for your kind help!

Shuisheng

Out of curiosity:
1. Why do the classes begin with 'C'?

2. What does the 'C' mean?

3. There is no requirement that identifiers start with 'C'.
I written C++ programs using Microsoft Visual C++ that don't
have any identifiers beginning with 'C'.

-- Thomas


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top