Hi all,
I'm hoping that some of you clever chaps could offer me some advice on code
reuse.
You see, whenever I make applications, I typically only find very limited
scope for code reuse. I also only find limited use for inheritance. For
example, the various types of users that my system might have to deal with.
I'm wondering if anyone could give me some tips on how to identify areas of
my design that could be reusable, where I can use inheritance and where to
use interfaces. I've read all the books that talk about why these things are
important but very few of them show you how to do it in the real world.
If anyone could point me to some online resources on this then that would be
great. I could also do with a couple of books on how to spot reusable
aspects of my designs and so on.
Any help would be great
Thanks all
Simon 2 1175
Hi, Simon
it's nice question because it is nearly same as "how can I live a fruitful
life" :-) No joking. Seriously.
As I see it, high-level design questions like this one are not in general
public domain because
- every person sees the world a bit differently from any another - to put it
mildly
- to prepare foundation for future is like trying to predict the future
- everything evolves and good today is bad tomorrow
However, I don't mean I know better. I would suggest to check http://hillside.net/patterns/DPBook/DPBook.html and possibly http://c2.com/cgi/wiki?HistoryOfPatterns, where you can see some of most
well-known names and references.
HTH
Alex
Simon... There are many opportunities for code reuse, but Inheritance
may be
over hyped. See Bloch:
Favor composition over inheritance
Effective Java Bloch
As for interfaces, I have some guidelines here:
Inheritance vs Interfaces http://www.geocities.com/jeff_louie/OOP/oop9.htm
Regards,
Jeff
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: James Cameron |
last post by:
Hi I'm developing a program and the client is worried about future
reuse of the code. Say 5, 10, 15 years down the road. This will be a
major factor in selecting the development language. Any comments on
past experience, research articles, comments on the matter would be
much appreciated. I suspect something like C would be the best based
on...
|
by: DPfan |
last post by:
What's exactly the meaning of "code reuse" in C++?
Why such kind of reuse have more advantages over the counterpart in other
language like in C?
How is "code reuse" realized in C++? By composition mainly? What're
others?
Thanks in advance for your comments!
|
by: patrick t music-images dt nl |
last post by:
Hi,
I'm evaluating Visual Studio and the .NET concept for his company, which
is currently using Borland C++ Builder.
Now I tried to create components/controls etc. in .NET and I can reuse
it very easily by adding the control to the toolbox. This is great and
more 'safe' to do than in Borland.
But... although I'm nice, I'm not so nice...
|
by: Simon |
last post by:
Hi all,
I'm hoping that some of you clever chaps could offer me some advice on code
reuse.
You see, whenever I make applications, I typically only find very limited
|
by: CR |
last post by:
I've noticed that the trend these days is to declare variables in the
middle of code instead of at the top. What is the advantage of this?
It seems like it makes it hard to reuse variables.
Here is how all the examples I've seen so far create an OleDbCommand
Object:
Dim cmd as new OleDbCommand("Select * FROM Table1",cnn)
I had to...
| |
by: Simon |
last post by:
Hi all,
I'm hoping that some of you clever chaps could offer me some advice on code
reuse.
You see, whenever I make applications, I typically only find very limited
|
by: sailor.gu |
last post by:
Hi all guys,
As an embeded programmer with five year C experience,
I did read many great books related with design, coding,
test,debug,algorithms, compiler, design, os, pm and others.
I always dream to achieve a refined and reusable design and
implementation.
I am very interested with code reuse.
|
by: Bart Simpson |
last post by:
I remember reading on parashift recently, that "Composition is for code
reuse, inheritance is for flexibility" see
(http://www.parashift.com/c++-faq-lite/smalltalk.html#faq-30.4)
This confused me somewhat as I have always thought you get code reuse
"for free" with inheritance. Am I missing something?. Will someone care
to explain ??
|
by: Jeff Dege |
last post by:
I'm working with a group that's been doing C++ coding for quite a long
time, now, and in that environment we've pretty much worked out
development practices that serve us well.
We've been doing more and more, over the last few years, in C# and
ASP.NET. Some web apps, some background services.
In our C++ code base, we have a fair number...
|
by: RichB |
last post by:
I am just trying to get to grips with C# and OOP, and one of the benefits
would seem to be code reuse. However I am not sure where to draw the line. I
have the following section of code:
if (ev.locationList != null)
{
//isListNull = true ensures that we do not recheck the list
every time we add a new item
bool isListNull = false;
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |