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

classes overview

hi all,
I'm "converting" a C program into C++. Before writing down code, I want
to redesign the whole structure in OO, I can do it with the old
pencil&paper but I'm searching a program to make more easy this step,
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?

thanks!!

Jul 23 '06 #1
6 1278
posted:
hi all,
I'm "converting" a C program into C++. Before writing down code, I want
to redesign the whole structure in OO, I can do it with the old
pencil&paper but I'm searching a program to make more easy this step,
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?

If you have a load of functions which look like the following:

void Initialise(Type *p);
void Func1(Type *p, int i);
int Func2(Type *p);
double *Func3(Type *p, unsigned long i);
void Func4(Type*p);
void Destroy(Type *p);

Then you might consider changing it to:

class Type {
public:

Type()
{
/* Instead of "Initialise" */
}

~Type()
{
/* Instead of "Destroy" */
}

void Func1(int i);
int Func2();
double *Func3(unsigned long i);
void Func4();

};

--

Frederick Gotham
Jul 23 '06 #2
In article <11**********************@m73g2000cwd.googlegroups .com>,
ti********@gmail.com wrote:
hi all,
I'm "converting" a C program into C++. Before writing down code, I want
to redesign the whole structure in OO, I can do it with the old
pencil&paper but I'm searching a program to make more easy this step,
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?

thanks!!
Get the book "Refactoring" by Martin Fowler, and possibly
"Object-Oriented Design Heuristics" by Arthur Riel. There is no easy way
to make the changes you are asking about, start with the lowest level
components and work your way up and good luck.
Jul 23 '06 #3
ti********@gmail.com wrote:
[cut]
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?
thank you guys for your answers!
I haven't explained so good, my question was more easy, actually!
Even if I'm not a guru, I know how to program in C++, I'm just
searching a simple software to write the structure of the project (as
diagrams for example), just to don't write by hand. Probably it is a
stupid question, I'm planning the class structure of the whole project
and I'm searching a way to do it not on paper (as usually I'm
habituated) but on PC, with a software easy to use, better if it is
printer-friendly... that's all!

thanks again!!
Mauro

Jul 23 '06 #4

ti********@gmail.com wrote:
ti********@gmail.com wrote:
[cut]
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?

thank you guys for your answers!
I haven't explained so good, my question was more easy, actually!
Even if I'm not a guru, I know how to program in C++, I'm just
searching a simple software to write the structure of the project (as
diagrams for example), just to don't write by hand. Probably it is a
stupid question, I'm planning the class structure of the whole project
and I'm searching a way to do it not on paper (as usually I'm
habituated) but on PC, with a software easy to use, better if it is
printer-friendly... that's all!

thanks again!!
Mauro
Try a google search for 'UML Design Tool' There are loads of free (and
paid-for) tools that should help you do what you're asking.

Jul 24 '06 #5
ti********@gmail.com wrote:
ti********@gmail.com wrote:
[cut]
>nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?

thank you guys for your answers!
I haven't explained so good, my question was more easy, actually!
Even if I'm not a guru, I know how to program in C++, I'm just
searching a simple software to write the structure of the project (as
diagrams for example), just to don't write by hand. Probably it is a
stupid question, I'm planning the class structure of the whole project
and I'm searching a way to do it not on paper (as usually I'm
habituated) but on PC, with a software easy to use, better if it is
printer-friendly... that's all!
Maybe look into UML (unified modeling language). A Google search
probably will lead to you software designed for this. Also, maybe try
asking on comp.programming or comp.object.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Jul 24 '06 #6
tirzanello wrote:
I'm "converting" a C program into C++.
Why?
Before writing down code, I want
to redesign the whole structure in OO, I can do it with the old
pencil&paper but I'm searching a program to make more easy this step,
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?
Nobody designs a program from scratch like that - even if it's a rewrite of
a pre-existing program.

The best technique is to alternate tiny design phases with tiny code (and
test) phases. Each step will cross-verify the other steps. That forces your
design to be implementable, useful, and testable.

If the current program has a design - even a C-style one - then it is far
above any "new UML design" you could draw. Your C program, presumably,
works. Any UML design you make might be pretty, but it _won't_work_ for a
very long time. You don't need that burden; you need to rapidly return value
to whoever hired you.

Please carefully reconsider why you want to rewrite this. If the answer is
"personal education", then by all means dive in and have fun. Use any
technique that tickles you.

If the answer is "to maintain the value of this code, while adding new
features", then read /Working Effectively with Legacy Code/ by Mike
Feathers, and change the code as incrementally as possible.

One important (and mercifully reversible) change you can start now is simply
recompiling the code as C-style C++ code. You may get syntax errors (and may
get the occassional crash). Forcing the code over this hump will improve it,
because C++ can be used more typesafely than C.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Jul 24 '06 #7

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

Similar topics

1
by: barnesc | last post by:
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects:...
1
by: Mark | last post by:
Is there an online site where the various methods of storing arrays of classes and variables are explained? For example, I'd love a grid that showed the various pluses and minues of an Array,...
1
by: Donald Welker | last post by:
I'm building a web forms project and would like to provide consistent connection, data adapter, dataset objects, etc. across multiple ASPX pages. I'm having problems with trying to make these...
11
by: Alex Maghen | last post by:
I love that I can create ASPX and ASCX files with CS code embedded or in code-behind files and ASP.NET will auto-compile it all for me. I *like* it that way Is there ANY way to have classes...
8
by: Mark | last post by:
I have it in my head that I saw a marketing document from Microsoft with the total number of classes and methods in the .NET Framework. Something like 70,000 methods? I don't need precise numbers,...
5
by: Jen | last post by:
I am fairly new to .NET and was wondering if someone could point me to a tutorial/overview of writing custom classes? Thank you.
6
by: Scott Mueller | last post by:
I have a question about simple binding: (please forgive any syntax errors... I am at home, where I do not have Vb.Net installed, and I rely far too much on Vb's intellisense!) If I have two...
8
by: news.chi.sbcglobal.net | last post by:
Hi. I am a little confused about the difference between a "value class" and a "ref class". I have the following code sample that shows the definition of a value class and of a ref class and...
6
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005, .net 2.0 and created a stand-alone windows application. I need to connect to Unix server on the network to read in a couple of files from it. I also am required to provide...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.