473,585 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 LotteryPredicto r
{
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 1987
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 NumberOfCorrect Balls(), 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******** ******@tk2msftn gp13.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 LotteryPredicto r
{
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******@NEWSi lopia.com> wrote in message
news:er******** ******@TK2MSFTN GP15.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 NumberOfCorrect Balls(), 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******** ******@tk2msftn gp13.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 LotteryPredicto r
{
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******** ******@TK2MSFTN GP10.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******@NEWSi lopia.com> wrote in message
news:er******** ******@TK2MSFTN GP15.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 NumberOfCorrect Balls(), 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******** ******@tk2msftn gp13.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 LotteryPredicto r
{
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******@NEWSi lopia.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP10.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******@NEWSi lopia.com> wrote in message
news:er******** ******@TK2MSFTN GP15.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 NumberOfCorrect Balls(), 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******** ******@tk2msftn gp13.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 LotteryPredicto r
> {
> 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********@dis cussions.micros oft.com> wrote in message
news:84******** *************** ***********@mic rosoft.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
33660
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 capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it...
137
7029
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 pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain...
125
14640
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 software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
121
9988
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 support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather...
35
5430
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 : %d\n",sizeof(unsigned char)); printf("short : %d\n",sizeof(short)); printf("unsigned short : %d\n",sizeof(unsigned short));...
39
3208
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
25771
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 paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990....
12
1980
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 pattern (make this code to be according to the bridge pattern), and what is the advantage of employing the bridge pattern? It seems "l'art pour...
123
6393
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 development of C++ have really made a mess of things, I mean templates and competing libraries and all that just render the code impossible to...
0
7836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8199
Oralloy
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. ...
0
8336
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6606
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5389
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...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.