Questions tagged [abstraction]

Abstraction is a computer science concept in which an implementation is separated from its interface.

Abstraction is a computer science concept in which an implementation is separated from its interface. Abstraction allows an implementation to be modified without changing the interface, so that other code which relies on this interface does not have to be modified.

For instance, a function prototype in C would be considered the function's interface, and its definition is considered the implementation. The function definition can change (for instance, to improve performance or fix a bug), but as long as the function signature (as specified by the prototype) is the same, any code calling the function can remain the same.

1121 questions
27
votes
7 answers

Using generics in abstract classes

I'm working on an abstract class where the implementing class needs to implement a list of T. The problem is that this doesn't work: public class AbstractClass { public int Id { get; set; } public int Name { get; set; } public abstract…
thaBadDawg
  • 5,160
  • 6
  • 35
  • 44
27
votes
1 answer

What are good abstractions for complex animations?

How do you approach designing and implementing complex UI interaction animations? (I'm not talking about specific languages and libraries like jQuery or UIKit, unless they force you into specific way of thinking about managing interdependent…
26
votes
2 answers

System.Web.Abstractions: what is it good for?

... absolutely nothing? What part of the puzzle does it fill for ASP.NET WebForms and ASP.NET MVC respectively? Can you somehow create a ASP.NET * base-application which uses System.Web.Abstractions so it can be used in both kinds of ASP.NET-web…
Seb Nilsson
  • 26,200
  • 30
  • 103
  • 130
22
votes
2 answers

How can you pass a List to a method?

I have a servlet with several methods that get a list of objects from the DAO, turn the list into JSON, and send it back in the response. Every list is made of objects that have a method: public String getAsJson(){...} And the servlet has a bunch…
Windle
  • 1,385
  • 2
  • 14
  • 33
21
votes
2 answers

Storing formatted text in a DB while maintaining abstraction

How would you store formatted blocks of text (line breaks, tabs, lists - etc.) in a database (nothing specific) to be displayed on the web (XHTML) while maintaining a level of abstraction so that the data can be used in other applications or if the…
Tom
  • 5,835
  • 4
  • 25
  • 30
20
votes
4 answers

Command Pattern seems needlessly complex (what am I failing to understand?)

I've read up on the Command Pattern, and I think I'm missing something. The Command object exists to abstract away the details of the Receiver object. It seems to me that we could simply stop here, and hold references to Command objects to execute…
19
votes
3 answers

How to use abstraction with ViewBinding with base activity?

I was making a base class so that all bindings for child will be set in base I have done till this abstract class BaseActivity2 : AppCompatActivity() { private var viewBinding: B? = null private var…
19
votes
3 answers

Does the Bridge Pattern decouples an abstraction from implementation?

I learned Bridge pattern from different articles and I have implemented that as per my understanding . One thing that is confusing me is bridge pattern says BridgePattern decouples an abstraction from its implementation so that the two can vary…
Ali
  • 557
  • 1
  • 9
  • 30
18
votes
1 answer

Wrapping DbSet with a custom DbSet/IDbSet?

First off, I think this is somewhat ridiculous to do but the other members of my team insist upon it and I can't come up with a good argument against it other than "I think it's dumb"... What we're trying to do is create a completely abstract data…
17
votes
5 answers

How to identify that code is over abstracted?

What should be the measures that should be used to identify that code is over abstracted and very hard to understand and what should be done to reduce over abstraction?
TalentTuner
  • 17,262
  • 5
  • 38
  • 63
16
votes
6 answers

What is exact difference between Inheritance and Abstract class?

I know the fundamentals of OOP concepts[Inheritance, Abstraction, Encapsulation, Polymorphism] We use Inheritance in case of Parent-Child relationship[Child can have all functionalities which Parent have and can add more functionality to itself…
Pratik Patel
  • 2,209
  • 3
  • 23
  • 30
15
votes
6 answers

more advantages or disadvantages to delegate members over classic functions?

class my_class { public int add_1(int a, int b) {return a + b;} public func add_2 = (a, b) => {return a + b;} } add_1 is a function whereas add_2 is a delegate. However in this context delegates can forfill a similar…
alan2here
  • 3,223
  • 6
  • 37
  • 62
15
votes
16 answers

What does "data abstraction" exactly mean?

What does data abstraction refer to? Please provide real life examples alongwith.
Naruto
  • 9,476
  • 37
  • 118
  • 201
15
votes
1 answer

Abstracting away from data structure implementation details in Clojure

I am developing a complex data structure in Clojure with multiple sub-structures. I know that I will want to extend this structure over time, and may at times want to change the internal structure without breaking different users of the data…
mikera
  • 105,238
  • 25
  • 256
  • 415
15
votes
2 answers

Is this a typical use case for IOC?

My current application allows users to define custom web forms through a set of admin screens. it's essentially an EAV type application. As such, I can't hard code HTML or ASP.NET markup to render a given page. Instead, the UI requests an instance…
1 2
3
74 75