Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could you imagine any other way to have OO implemented than the classic class-based approach?

Tags:

oop

class

I've lately been thinking a lot about alternatives to the class-based approach to object-orientation. One thing which bugs me in today's languages is that we often use static classes / singletons to design single (global) objects because there isn't any other way to do it, so in my opinion it's rather a hack than a feature. Another thing is that Java for instance allows the programmer to have enums with additional data (global state) and functionality which make them kind of object in my eyes, too.

Anyway, what I'd like to know is whether you have any ideas for a different approach to object-orientation in a compiled and efficient language (therefore, creating objects by prototyping is probably not a good idea) or, if you don't have any, whether there're things in the classic OO approach which bug you a lot, too.

[EDIT]: Just to make things clear. As indicated above I already know prototype-based programming.

like image 741
balu Avatar asked Feb 03 '09 15:02

balu


People also ask

How object-oriented programming is implemented?

Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc. in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

How do you implement a new requirement using object-oriented approach?

The objective of this phase is to design and refine the classes, attributes, methods, and structures that are identified during the analysis phase, user interface, and data access. This phase also identifies and defines the additional classes or objects that support implementation of the requirement.

Which methods are used for object-oriented?

Four core concepts of object-oriented programming are abstraction, encapsulation, inheritance and polymorphism. Using abstraction, a programmer hides many of the details about an object and shows only the most relevant information.

What is the main approach used by OOP to solve problems?

The object-oriented problem solving approach, in general, can be devided into four steps. They are: (1) Identify the problem, (2) Identify the objects needed for the solution, (3) Identify messages to be sent to the objects, and (4) Create a sequence of messages to the objects that solve the problem.


1 Answers

Check out prototype-based programming.

like image 74
starblue Avatar answered Feb 22 '23 04:02

starblue