abstraction

What's the difference between abstraction and generalization?

本小妞迷上赌 提交于 2019-12-03 02:38:40
问题 I understand that abstraction is about taking something more concrete and making it more abstract. That something may be either a data structure or a procedure. For example: Data abstraction: A rectangle is an abstraction of a square. It concentrates on the fact a square has two pairs of opposite sides and it ignores the fact that adjacent sides of a square are equal. Procedural abstraction: The higher order function map is an abstraction of a procedure which performs some set of operations

Meaning of Leaky Abstraction?

柔情痞子 提交于 2019-12-03 01:46:56
问题 What does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.) 回答1: Here's a meatspace example: Automobiles have abstractions for drivers. In its purest form, there's a steering wheel, accelerator and brake. This abstraction hides a lot of detail about what's under the hood: engine, cams, timing belt, spark plugs, radiator, etc. The neat thing about this abstraction is that we can replace parts of the implementation with improved

What does “abstract over” mean?

空扰寡人 提交于 2019-12-03 00:02:34
问题 Often in the Scala literature, I encounter the phrase "abstract over", but I don't understand the intent. For example, Martin Odersky writes You can pass methods (or "functions") as parameters, or you can abstract over them. You can specify types as parameters, or you can abstract over them. As another example, in the "Deprecating the Observer Pattern" paper, A consequence from our event streams being first-class values is that we can abstract over them. I have read that first order generics

A brilliant example of effective encapsulation through information hiding?

那年仲夏 提交于 2019-12-02 23:49:47
" Abstraction and encapsulation are complementary concepts: abstraction focuses on the observable behavior of an object... encapsulation focuses upon the implementation that gives rise to this behavior... encapsulation is most often achieved through information hiding , which is the process of hiding all of the secrets of object that do not contribute to its essential characteristics." - Grady Booch in Object Oriented Analysis and Design Can you show me some powerfully convincing examples of the benefits of encapsulation through information hiding? The example given in my first OO class:

What does “data abstraction” exactly mean?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 23:35:09
What does data abstraction refer to? Please provide real life examples alongwith. Abstraction has two parts: Hide details that don't matter from a certain point of view Identify details that do matter from a certain point of view and consider items to be of the the same class if they possess those details. For example, if I am designing a program to deal with inventory, I would like to be able to find out how many items of a certain type the system has in stock. From the perspective of the interface system, I don't care if I am getting this information from a database, a csv file, a remote

Meaning of Leaky Abstraction?

喜夏-厌秋 提交于 2019-12-02 17:02:22
What does the term "Leaky Abstraction" mean? (Please explain with examples. I often have a hard time grokking a mere theory.) Here's a meatspace example: Automobiles have abstractions for drivers. In its purest form, there's a steering wheel, accelerator and brake. This abstraction hides a lot of detail about what's under the hood: engine, cams, timing belt, spark plugs, radiator, etc. The neat thing about this abstraction is that we can replace parts of the implementation with improved parts without retraining the user. Let's say we replace the distributor cap with electronic ignition, and we

What's the difference between abstraction and generalization?

南笙酒味 提交于 2019-12-02 16:13:16
I understand that abstraction is about taking something more concrete and making it more abstract. That something may be either a data structure or a procedure. For example: Data abstraction: A rectangle is an abstraction of a square. It concentrates on the fact a square has two pairs of opposite sides and it ignores the fact that adjacent sides of a square are equal. Procedural abstraction: The higher order function map is an abstraction of a procedure which performs some set of operations on a list of values to produce an entirely new list of values. It concentrates on the fact that the

What does “abstract over” mean?

痴心易碎 提交于 2019-12-02 13:49:32
Often in the Scala literature, I encounter the phrase "abstract over", but I don't understand the intent. For example , Martin Odersky writes You can pass methods (or "functions") as parameters, or you can abstract over them. You can specify types as parameters, or you can abstract over them. As another example, in the "Deprecating the Observer Pattern" paper, A consequence from our event streams being first-class values is that we can abstract over them. I have read that first order generics "abstract over types", while monads "abstract over type constructors". And we also see phrases like

Providing array or list of class objects via WCF

冷暖自知 提交于 2019-12-02 01:38:50
Any example of WCF client server providing of List or Array of custom class objects would help me! But here is what I have got so far: Here is my class system I want to provide namespace NEN_Server.FS { [Serializable()] public class XFS { private List<NFS> files; public XFS() { files = new List<NFS>(); } public List<NFS> Files { get { return files; } set { files = value; } } } } where NFS is namespace NEN_FS { public interface INFS : IEquatable<NFS> { string Path { get; set; } } [Serializable()] abstract public class NFS : INFS { abstract public string Path { get; set; } public NFS() { Path =

overriding equals method when dealing with inheritance

ⅰ亾dé卋堺 提交于 2019-12-02 01:33:55
I have been reading about how best to override the equals method when dealing with subclasses and here I have found quite a few posts. They recommend different ways of implementing a solution using instanceof or getClass() to compare objects of different sub classes. However with reference to Effective Java, my understanding is (and I am new to this so I may well be wrong!) Bloch argues that in the end both can be problematic, “There is no way to extend an instantiable class and add a value component while preserving the equals contract, unless you are willing to forgo the benefits of object