Please log in.
Before you can vote, you need to register. Please log in or create an account.
Computer: Programming Language
Flat OO   (+5, -1)  [vote for, against]
"Like" construct replaces Object Oriented inheritance and interface writing

Compiling the following definitions in FlatOO gives an object hierarchy in a regular OO language (smalltalk, java, C#, C++...) So you dont need to "design" the hierarchy.

The compiler can also find equivalents, and shorten your code, and the IDE can help you when you write Different or Like to show you what the possibilities are.

Struct S:
...

Object A:
Member m
Method:a()
Params: b,c,d
Returns: Like S

Property:P
Set params: e,f.
Returns: Like method a

Object B
Like A
Without P
Different B Insteadof bla1 Does blu
Different B Insteadof bla2 Does blu1
Different B returns C
-- pashute, Mar 10 2006

1/2 b reads

returns bun

trusting you know what you are talking about
-- zeno, Mar 10 2006


Uh...... hmm... uh.. uh.. I am so lost and confused that I decided to bun it also.
-- Jscotty, Mar 10 2006


[m-f-d], Genetic engineering magic.
-- Shz, Mar 10 2006


If you understand this domain then comment, else don't.

Especially clueless mfd suggestions.
-- bristolz, Mar 10 2006


It's a joke, [bris], but not a clueless one. In this idea [pashute] has replaced normal OO polymorphism with a more granular and controlled method of inheritance (and the reverse), much like genetic engineering. If I were mfd-ing, I'd spell it out.
-- Shz, Mar 10 2006


Ah, okay. Sorry, [Shz]. I think I have a vague notion of what is being proposed but it's well out of my understanding.

Not sure I understand the expression, "Although not entirely exactly like this at all...," either. ;-)
-- bristolz, Mar 10 2006


No worries, [bris] - it's Friday! I have no idea if a compiler can be written to understand this, but it is an interesting concept, possibly deserving a paradigm name of its own, and certainly halfbaked, so +.
-- Shz, Mar 10 2006


So this is nothing to do with model railways...?
-- DrCurry, Mar 10 2006


This is nice. Very nice. I know exactly what you are saying. Would be hell to write the first compiler, but still.

As a Java programmer-in-the-making, I know this would be very, very, useful. It is hard to explain to non-programmers.

Big, hearty programmer's bun for you.
-- DesertFox, Mar 11 2006


Thanks and sorry to all non-programmers. I dont know what the javascripts prototype is, but here I'm "deleting" as well as adding functionality directly to an inherited class, from it's "brother. When you compile, you get an automatic class hierarchy, perhaps asking you if it should be interface implementation or class inheritance.
-- pashute, Mar 12 2006


FlatOO is about making programming easier.

I suppose you Are using arraylists, databasese objects, web or XML objects etc. All of these extensively use inheritance and interfacing. Anything that is not just an end package (i.e. any DLL or API or framework) must use inheritance. And that is what FlatOO is for. If you are just writing a WinForm with a few buttons, use the current langauges and available IDEs.
-- pashute, Mar 12 2006


// .. caveat developer.
-- reensure, Mar 13 2006


Not meant to be tart :)
-- reensure, Mar 13 2006


Well, take of the lipstick and the fishnet stockings, and remove that stupid wig!
-- DrCurry, Mar 13 2006


na, i like the only difference being my choice of who i have sex with.
-- reensure, Mar 13 2006



random, halfbakery