It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 13 years ago.
Is there something special about an Employee entity that makes it desirable to use it so frequently in programming texts?
Are there any other entities that would serve just as well?
Obviously; anything specifying a hierarchy will be helpful; Employee is used because it's most common and trivially understood conceptually (i.e. it's easy to visualise). It's harder to visualise B : A.
In case it's not obvious; it's used because it's useful for learning about OO in terms of the hierarchy/polymorphism functions, and allows it to direct relate to something almost everyone has experience with.
It is the same thing that happens with Introductions to programming where they use Animal as the base of an objects hierarchy. Maybe because everyone in this world knows what Employee and Animal mean!
It's all about hierarchy. Student / Teacher / Classes / School works too.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I recently was asked this question in an interview and would like to hear the answer from you people.
I discussed about code resuability and security that can be achieved by encapsulation and inheritance but the interviewer did not seem satisfied.
He insisted on how exactly an application user is benefited by using applications developed on the principles of oop.
Depends. Purists (and morons) will apply abstraction to every possible bit of code they generate or come across. This is completely unnecessary in something as simple as a direct, simple MySQL call from within a tiny bit of PHP, to log site accesses, for instance.
However, generally OOP can save you plenty of cycles if applied systematically to big data involving lots of information shuffling, like sorting hundreds of rows of data on every page access. It's a matter of when to use OOP and when to just write procedural code. OOP takes time and effort and is maintainable by experienced programmers, but you need to ask yourself if it is worth all that extra hassle on a tiny snippet of code that does one thing internally.
There are plenty of good articles out there (http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/) that help you to understand WHY OOP is sometimes unnecessary and in fact harmful.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to implement an app that is a test of intelligence. Do I have to use CoreData, or what alternatives do I have?
If so, do you have a good CoreData tutorial or similar reference?
Thanks a lot!
CoreData is just a persistance layer. You can store your data in whatever medium works best for you.
Hardcoded in classes
In plists
In flat files
CoreData is nice because it gives you the full power of a relational database behind a set of abstraction classes that work well in an object orientated environment, but you never have to use it.
For learning CoreData I found the Marcus Zarra book to be good.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I find that creating SQL tables tedious when starting to create a web app (ASP/Python/PHP).
Do you guys know any tools that makes creating tables quicker and faster and easier? Thanks in advance! :-)
In my opinion writing a CREATE TABLE statement is far less tedious than writing HTML pages.
The recommended approach is to use a ER design tool co create and define your database model. Most (if not all) ER designer can then create the necessary DDL statement directly from the model.
With this approach you also have a documentation of your database model which is always a good thing.
It depends on the tools/libraries you use to create your app.
If you use an ORM, many ORMs offer you the possibility to create the database with all tables automatically, according to the classes and mappings you defined in your application.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
As we know that the Object oriented programming language has lots of benefit.But in same implementation procedural language like C do not have any alternative like realtime applications. So can we combine the power of two to create a great application?
Can we experience the major pillars of OOPS in procedural language?
Nearly all general-purpose languages are Turing equivalent. This means -- among other thing -- that anything you can dream up in one language, you can implement in another. So yes, it's possible, though it isn't enforced by the compiler as strictly as an OOP zealot might like.
Consider C's FILE type (used by fopen, fread, fwrite, etc). It's not specified what exactly is in there, and you don't need to know or care (read: encapsulation); all you have to know is, you can fopen you a file, fread/fwrite it, and when you're done, you fclose. Thing is, that "file" can be anywhere -- at the root of the FS, in your homedir that's on a whole other drive...in most OSes, it can even be a pipe or a network socket (read: polymorphism).
Basically, the funnest parts of OOP. And we didn't say "class" even once. :)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Are object oriented languages more powerful than declarative programming languages? By powerful I mean are they able to solve a class of problems that any program written in a declarative programming language can't?
Personally I don't think so. There exists a set of problems for which it is easier to write a program using an object-oriented language, but I think those problems could be solved using declarative languages too (albeit it might be harder to so)
Would like to hear more views on this one.
Go read up on Turing completeness. It basically means any turing complete language can solve any problem a turing machine can.
And most languages are turing complete. (I doubt you'd ever use a non turing complete language).
Alternatively you can think of it as you can solve any problem with Ook! even though it's a very silly language.