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

What comes first, the abstraction or the implementation?!

this might sound like an obvious question but I have found that usually
these two evolve at the same time.
One of the biggest reasons for creating the abstraction in the first place
(in my opinion) is to create a reusable framework that can be applied to
similar projects. However I have found that if an abstraction is created
first during the development phase, when the implementation is occurring,
the functionality or intended behaviour of the abstraction is not always the
best way of doing something. This leads to changes in both the implementing
class and the abstract one.

e.g.
public abstract class LotteryPredictor
{
public abstract bool WinLottery();
}
//You then realise in your implementation that just knowing the result of
WinLottery (true or false) is better indicated via a return of an int 0
=fail zero balls correct, 1= fail one ball correct, ... 6= won all balls
correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am saying
but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the abstraction,
does this mean that the abstraction was poorly designed in the first place
OR is it completely valid to go back to the abstraction and fine tune it
(obviously bearing in mind that only one class currently implements it)?

As a side note, what do people find to be the best design methodology? I
know that UML seems to be pretty popular at the moment, but I am yet to be
convinced how useful it is -it just seems to overcomplicate the design.

Br,

Mark.
Nov 16 '05 #1
6 1969
Hello,

I will keep it to your example.

I would assume that WinLottery() would return true if you won, and false if
you lost. But a method called NumberOfCorrectBalls(), would return the
number of correct balls.

You changed the meaning of the method, because it was not what you wanted
_in the current project_. But what about other projects? What if you need a
method that only returns true or false, because you do not care how many
correct balls there were, you only want to know if there was a win or lose?

What i mean is that you did not found out what you really needed, before you
started with the implementation.

Of course you can go back and re-design, but usually, this means that you
did a poor design in the first place. This usually also means that the
development time will be extended, which costs money. It is better to
completely understand what you want, and need, before you start writing the
code.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
this might sound like an obvious question but I have found that usually
these two evolve at the same time.
One of the biggest reasons for creating the abstraction in the first place
(in my opinion) is to create a reusable framework that can be applied to
similar projects. However I have found that if an abstraction is created
first during the development phase, when the implementation is occurring,
the functionality or intended behaviour of the abstraction is not always the best way of doing something. This leads to changes in both the implementing class and the abstract one.

e.g.
public abstract class LotteryPredictor
{
public abstract bool WinLottery();
}
//You then realise in your implementation that just knowing the result of
WinLottery (true or false) is better indicated via a return of an int 0
=fail zero balls correct, 1= fail one ball correct, ... 6= won all balls
correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am saying but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the abstraction, does this mean that the abstraction was poorly designed in the first place
OR is it completely valid to go back to the abstraction and fine tune it
(obviously bearing in mind that only one class currently implements it)?

As a side note, what do people find to be the best design methodology? I
know that UML seems to be pretty popular at the moment, but I am yet to be
convinced how useful it is -it just seems to overcomplicate the design.

Br,

Mark.

Nov 16 '05 #2
Thanks for your response.
I agree that the meaning was changed (and therefore the original design was
therefore probably poorly designed).
But I wonder how often this happens in the real world especially when
sometimes we are striving towards a goal that we are not entirely sure about
what it is and what it might become. This is probably a design failing on my
part but I wonder if it is actually the reality of design?
I am currently working on a pet project that it's most basic level will
effectively store data. I have a loose design on it's mechanics and the way
it will be able to work *but* cannot finalise a design because I keep
changing my mind as to it's exact workings and how to optimise them. Until I
create a prototype I don't think that I will have a strong idea as to how
this program should really (or best) work ...and what it should be able to
do.

Br,

Mark.

"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
Hello,

I will keep it to your example.

I would assume that WinLottery() would return true if you won, and false if you lost. But a method called NumberOfCorrectBalls(), would return the
number of correct balls.

You changed the meaning of the method, because it was not what you wanted
_in the current project_. But what about other projects? What if you need a method that only returns true or false, because you do not care how many
correct balls there were, you only want to know if there was a win or lose?
What i mean is that you did not found out what you really needed, before you started with the implementation.

Of course you can go back and re-design, but usually, this means that you
did a poor design in the first place. This usually also means that the
development time will be extended, which costs money. It is better to
completely understand what you want, and need, before you start writing the code.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
this might sound like an obvious question but I have found that usually
these two evolve at the same time.
One of the biggest reasons for creating the abstraction in the first place (in my opinion) is to create a reusable framework that can be applied to
similar projects. However I have found that if an abstraction is created
first during the development phase, when the implementation is occurring, the functionality or intended behaviour of the abstraction is not always

the
best way of doing something. This leads to changes in both the

implementing
class and the abstract one.

e.g.
public abstract class LotteryPredictor
{
public abstract bool WinLottery();
}
//You then realise in your implementation that just knowing the result of WinLottery (true or false) is better indicated via a return of an int 0
=fail zero balls correct, 1= fail one ball correct, ... 6= won all balls
correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am

saying
but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the

abstraction,
does this mean that the abstraction was poorly designed in the first place OR is it completely valid to go back to the abstraction and fine tune it
(obviously bearing in mind that only one class currently implements it)?

As a side note, what do people find to be the best design methodology? I
know that UML seems to be pretty popular at the moment, but I am yet to be convinced how useful it is -it just seems to overcomplicate the design.

Br,

Mark.


Nov 16 '05 #3
I suppose it depends on the type of project, and the experience of the
development people.

If the customer cannot decide what they need, or don't know yet, there will
be alot of changes. It is possible that the development will be very close
to the customer, and the application will be written so that it can be used
by the customer during development (and therefore, the design of the code is
not high-priority, as long as the customer gets business value).

If the development team is facing something new, they have never dealt with
before, there will also be some changes, until they have decided what is
best. It is also possible that they need to create prototypes, or "Spike
Solutions" [1].

It is not unusual that a development team uses prototyping.

So, of course it happens that you need to do something that you later throws
away. It probably depends a bit on the experience you have. But, you also
need to realize that writing code that you later must throw away, will
extend the development time. You also must realize that there is a need to
spend time on the design, and not just re-design everything during the time
you write code. Because that often results in a poorly designed application
(and the development time was probably longer as well).

I think that you should also consider if "optimizing" the code is important
for this application. Is it really necessary that it takes 0.04 seconds less
to store the data? Because that is probably the time frame we are talking
about here. Is it necessary to have a good framework, so that you can extend
the application? Will you ever extend the application?

Sometimes, it is best to just write the code, without thinking too much
about the design, because that just complicates the project, and too much
time is spent on finding the best design ever. And if it is not necessary to
have the best design, and the fastest application, why spend time on that?
Maybe the customer needs the application now, and not a few months later,
and they don't care if the application could be 0.04 seconds faster? (This
is also a bit of XP thinking, "use the simpliest solution possible, without
complicating anything").
[1] XP terminology, http://www.extremeprogramming.org/rules/spike.html
PS: XP should only be used in small (or very small) projects.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
Thanks for your response.
I agree that the meaning was changed (and therefore the original design was therefore probably poorly designed).
But I wonder how often this happens in the real world especially when
sometimes we are striving towards a goal that we are not entirely sure about what it is and what it might become. This is probably a design failing on my part but I wonder if it is actually the reality of design?
I am currently working on a pet project that it's most basic level will
effectively store data. I have a loose design on it's mechanics and the way it will be able to work *but* cannot finalise a design because I keep
changing my mind as to it's exact workings and how to optimise them. Until I create a prototype I don't think that I will have a strong idea as to how
this program should really (or best) work ...and what it should be able to
do.

Br,

Mark.

"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
Hello,

I will keep it to your example.

I would assume that WinLottery() would return true if you won, and false if
you lost. But a method called NumberOfCorrectBalls(), would return the
number of correct balls.

You changed the meaning of the method, because it was not what you wanted
_in the current project_. But what about other projects? What if you need a
method that only returns true or false, because you do not care how many
correct balls there were, you only want to know if there was a win or lose?

What i mean is that you did not found out what you really needed, before

you
started with the implementation.

Of course you can go back and re-design, but usually, this means that

you did a poor design in the first place. This usually also means that the
development time will be extended, which costs money. It is better to
completely understand what you want, and need, before you start writing

the
code.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
this might sound like an obvious question but I have found that usually these two evolve at the same time.
One of the biggest reasons for creating the abstraction in the first place (in my opinion) is to create a reusable framework that can be applied to similar projects. However I have found that if an abstraction is created first during the development phase, when the implementation is occurring, the functionality or intended behaviour of the abstraction is not always the
best way of doing something. This leads to changes in both the

implementing
class and the abstract one.

e.g.
public abstract class LotteryPredictor
{
public abstract bool WinLottery();
}
//You then realise in your implementation that just knowing the result of WinLottery (true or false) is better indicated via a return of an int
0 =fail zero balls correct, 1= fail one ball correct, ... 6= won all balls correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am

saying
but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the

abstraction,
does this mean that the abstraction was poorly designed in the first

place OR is it completely valid to go back to the abstraction and fine tune it (obviously bearing in mind that only one class currently implements it)?
As a side note, what do people find to be the best design methodology? I know that UML seems to be pretty popular at the moment, but I am yet to be
convinced how useful it is -it just seems to overcomplicate the

design.
Br,

Mark.



Nov 16 '05 #4
Thanks for your time Kristofer. I'll check out the url.

Cheers!

"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I suppose it depends on the type of project, and the experience of the
development people.

If the customer cannot decide what they need, or don't know yet, there will be alot of changes. It is possible that the development will be very close
to the customer, and the application will be written so that it can be used by the customer during development (and therefore, the design of the code is not high-priority, as long as the customer gets business value).

If the development team is facing something new, they have never dealt with before, there will also be some changes, until they have decided what is
best. It is also possible that they need to create prototypes, or "Spike
Solutions" [1].

It is not unusual that a development team uses prototyping.

So, of course it happens that you need to do something that you later throws away. It probably depends a bit on the experience you have. But, you also
need to realize that writing code that you later must throw away, will
extend the development time. You also must realize that there is a need to
spend time on the design, and not just re-design everything during the time you write code. Because that often results in a poorly designed application (and the development time was probably longer as well).

I think that you should also consider if "optimizing" the code is important for this application. Is it really necessary that it takes 0.04 seconds less to store the data? Because that is probably the time frame we are talking
about here. Is it necessary to have a good framework, so that you can extend the application? Will you ever extend the application?

Sometimes, it is best to just write the code, without thinking too much
about the design, because that just complicates the project, and too much
time is spent on finding the best design ever. And if it is not necessary to have the best design, and the fastest application, why spend time on that?
Maybe the customer needs the application now, and not a few months later,
and they don't care if the application could be 0.04 seconds faster? (This
is also a bit of XP thinking, "use the simpliest solution possible, without complicating anything").
[1] XP terminology, http://www.extremeprogramming.org/rules/spike.html
PS: XP should only be used in small (or very small) projects.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
Thanks for your response.
I agree that the meaning was changed (and therefore the original design was
therefore probably poorly designed).
But I wonder how often this happens in the real world especially when
sometimes we are striving towards a goal that we are not entirely sure

about
what it is and what it might become. This is probably a design failing on my
part but I wonder if it is actually the reality of design?
I am currently working on a pet project that it's most basic level will
effectively store data. I have a loose design on it's mechanics and the way
it will be able to work *but* cannot finalise a design because I keep
changing my mind as to it's exact workings and how to optimise them. Until I
create a prototype I don't think that I will have a strong idea as to
how this program should really (or best) work ...and what it should be able to do.

Br,

Mark.

"Kristofer Gafvert" <kg******@NEWSilopia.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl...
Hello,

I will keep it to your example.

I would assume that WinLottery() would return true if you won, and false
if
you lost. But a method called NumberOfCorrectBalls(), would return the
number of correct balls.

You changed the meaning of the method, because it was not what you wanted _in the current project_. But what about other projects? What if you need
a
method that only returns true or false, because you do not care how

many correct balls there were, you only want to know if there was a win or

lose?

What i mean is that you did not found out what you really needed, before you
started with the implementation.

Of course you can go back and re-design, but usually, this means that you did a poor design in the first place. This usually also means that the
development time will be extended, which costs money. It is better to
completely understand what you want, and need, before you start
writing the
code.

--
Regards,
Kristofer Gafvert
http://www.ilopia.com
"Mark Broadbent" <no************@no-spam-please.com> wrote in message
news:Or**************@tk2msftngp13.phx.gbl...
> this might sound like an obvious question but I have found that usually > these two evolve at the same time.
> One of the biggest reasons for creating the abstraction in the first

place
> (in my opinion) is to create a reusable framework that can be
applied to > similar projects. However I have found that if an abstraction is created > first during the development phase, when the implementation is occurring,
> the functionality or intended behaviour of the abstraction is not always the
> best way of doing something. This leads to changes in both the
implementing
> class and the abstract one.
>
> e.g.
> public abstract class LotteryPredictor
> {
> public abstract bool WinLottery();
> }
> //You then realise in your implementation that just knowing the
result of
> WinLottery (true or false) is better indicated via a return of an

int 0 > =fail zero balls correct, 1= fail one ball correct, ... 6= won all balls > correct. Therefore the abstraction would be public abstract int
> WinLottery();
>
> I know the above is not the greatest example to demonstrate what I
am saying
> but it gives an idea.
>
> So onto the questions.....
> If the functionality of the implementation moves away from the
abstraction,
> does this mean that the abstraction was poorly designed in the first place
> OR is it completely valid to go back to the abstraction and fine

tune it > (obviously bearing in mind that only one class currently implements it)? >
> As a side note, what do people find to be the best design
methodology?
I > know that UML seems to be pretty popular at the moment, but I am yet to
be
> convinced how useful it is -it just seems to overcomplicate the

design. >
> Br,
>
> Mark.
>
>



Nov 16 '05 #5
instead, why not just create "code" and if it needs changing, change it. The
fact that you haven't got an interface doesn't prevent it from being generic.
//You then realise in your implementation that just knowing the result of
WinLottery (true or false) is better indicated via a return of an int 0
=fail zero balls correct, 1= fail one ball correct, ... 6= won all balls
correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am saying
but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the abstraction,
does this mean that the abstraction was poorly designed in the first place
OR is it completely valid to go back to the abstraction and fine tune it
(obviously bearing in mind that only one class currently implements it)?

As a side note, what do people find to be the best design methodology?
Brain power and imagination.
I
know that UML seems to be pretty popular at the moment, but I am yet to be
UML is a flowery, good-for-nothing technology for posh toffs in poncey wine
bars.
convinced how useful it is -it just seems to overcomplicate the design.
It's just doing extra work for no gain - you could go and dig a great whole
in a field and fill it in again - and yes, it would be work - but it wouldn't
get you very far.

Br,

Mark.

Nov 16 '05 #6
I get the impression you are a no nonsense kinda gal :)

Must admit that I sort of agree with your sentiments - hard bit is trying to
convince the posh toff employers or those that seize buzz word technologies
and push them on others without really seeing whether they are a good fit
for the situation in hand.

Thx for your comments.

Br,

Mark.

"Patty O'Dors" <Pa********@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
instead, why not just create "code" and if it needs changing, change it. The fact that you haven't got an interface doesn't prevent it from being generic.
//You then realise in your implementation that just knowing the result of WinLottery (true or false) is better indicated via a return of an int 0
=fail zero balls correct, 1= fail one ball correct, ... 6= won all balls
correct. Therefore the abstraction would be public abstract int
WinLottery();

I know the above is not the greatest example to demonstrate what I am saying but it gives an idea.

So onto the questions.....
If the functionality of the implementation moves away from the abstraction, does this mean that the abstraction was poorly designed in the first place OR is it completely valid to go back to the abstraction and fine tune it
(obviously bearing in mind that only one class currently implements it)?

As a side note, what do people find to be the best design methodology?
Brain power and imagination.
I
know that UML seems to be pretty popular at the moment, but I am yet to

be
UML is a flowery, good-for-nothing technology for posh toffs in poncey wine bars.
convinced how useful it is -it just seems to overcomplicate the design.
It's just doing extra work for no gain - you could go and dig a great

whole in a field and fill it in again - and yes, it would be work - but it wouldn't get you very far.

Br,

Mark.

Nov 16 '05 #7

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

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
35
by: Sunil | last post by:
Hi all, I am using gcc compiler in linux.I compiled a small program int main() { printf("char : %d\n",sizeof(char)); printf("unsigned char : ...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
12
by: Adrian | last post by:
The code below was taken from an example. All the "noise" in the example was thrown out. This is supposedly according to the bridge pattern. What in the code (which lines) represent the bridge...
123
by: plenty900 | last post by:
I was looking over someone's C++ code today and despite having written perfectly readable C++ code myself, the stuff I was looking at was worse than legalese. The people who are guiding the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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 projectplanning, 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.