Timeline for What problems of procedural programming does OOP solve in practice?
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 10, 2015 at 17:15 | comment | added | vonbrand |
@user31782, using e.g. C i can define a variable as static and restrict access to just the file it is defined in. Modular programming, Parnas' style, with access restrictions enforced by the procedural language.
|
|
Mar 27, 2014 at 17:33 | comment | added | Rob | Anupam: examples: ctx := NewDataBackendContext() ctx.login(username,password) ctx.addPurchase(item) //user disappears for a long time //and as long as server has ctx in memory, it can //impersonate the user to the backend. ctx.commitPurchase() In a procedural language, if ctx is a data structure with sensitive data, you have to add some indirection to ensure that given a ctx you can't find ctx.password somehow (from code - we assume that you can't just read memory at will). | |
Mar 27, 2014 at 17:16 | comment | added | Rob | "Secure" or "Correct" don't mean anything without a specification. These things are attempts to put a specification on code towards that goal: Types, Class Definitions, DesignByContract,etc. You get "Security" in the sense that you can make the private data boundaries inviolable; assuming that you must obey the virtual machine instruction set in order to execute. Object Orientation won't hide internal memory from somebody that can read memory directly, and a bad object protocol design is handing out secrets by design. | |
Mar 27, 2014 at 16:41 | comment | added | user31782 | Illustrate with the code, that is first with a Procedural code and then writing the same code in oop. Please explain in detail. I am not getting what do we mean by 'secure' in programming. | |
Mar 27, 2014 at 16:29 | comment | added | manu | Give me your credit card number. I will not modify or corrupt it. I will just use it and purchase something with it. That should be secure, right? Or if you want me to illustrate using the picture example, haven't you heard of impersonation? | |
Mar 27, 2014 at 4:31 | comment | added | user31782 | I did not got it. If some function does not modifies or corrupt our global data then what's wrong our original data is still secure. You say "picture I posted and thus protect it from possible misuse.". if we consider the picture as a global data and no one can modify it then how can someone misuse it? | |
Mar 27, 2014 at 4:22 | comment | added | manu | If I post a picture on facebook, as facebook can be accessed globally it becomes a global argument. However, if I restrict the access of my post to only my friends, I ensure that no stranger can access the picture I posted and thus protect it from possible misuse (my data is secure). On the other hand, consider that I have no way of controlling who reads my posts (data), then there's no security for what I post on the internet. In procedural programming there are no access modifiers, so all free variables can be accessed by any procedure. | |
Mar 27, 2014 at 4:07 | comment | added | user31782 | Why restricting the usage of global data to certain classes is secure? Can't we do the same in procedural programming? Would you be able to explain with some example. | |
Mar 27, 2014 at 3:52 | comment | added | manu | I am not talking about corruption of data, I am talking about the ability to restrict access to data. | |
Mar 27, 2014 at 3:51 | comment | added | user31782 | You mean that in OOP classes do not corrupt the global data. | |
Mar 27, 2014 at 3:49 | comment | added | manu | If you don't declare it globally it's not a global variable. | |
Mar 27, 2014 at 3:47 | comment | added | user31782 | In procedural programming too we can restrict the usage of global variable by using the variable to certain functions, that is by not declaring any data global. | |
Mar 27, 2014 at 2:00 | comment | added | manu | In procedural programming one can't restrict the usage of a global variable. Any function could use it's value. However in OOP I could restrict the usage of a variable to a certain class alone or only the classes that inherit it perhaps. | |
Mar 26, 2014 at 9:59 | comment | added | user31782 | What are the data security issues present in the procedural programming? | |
Mar 25, 2014 at 22:04 | review | First posts | |||
Mar 25, 2014 at 22:41 | |||||
Mar 25, 2014 at 21:49 | history | edited | manu | CC BY-SA 3.0 |
deleted 1 characters in body
|
Mar 25, 2014 at 21:43 | history | answered | manu | CC BY-SA 3.0 |