New answers tagged

0

If I remember right ADTs are abstract types. This means they are not expressed or implemented in any language. Java interface is already a specific representation of some possible abstract Iterator written or depicted on paper, on desk or as part of UML diagram for example. But java.util.Iterator is definitely a very close representation of what possible ...


1

So, may I state that an Iterator is an abstract data type? An ADT is a collection of data and a set of operations that may be performed on that data. An iterator is composed of a set of data to iterate and a set of operations for performing that iteration. Importantly, those operations do not define how the operator is performed. So an iterator - in general ...


6

A Tale of Abstractions There's a lot of confusion about this on the Internet, but the term is quite technical, and according to the Cook paper (referenced in the answer liked to by Greg Burghardt), it essentially boils down to this. OOP Objects (and the related static typing mechanisms, including classes, abstract classes and interface types) and ADTs ...


2

A. They're used to describe the API of various classes. Correct. I struggle with the correctness of the phrasing. It's not wrong, but it is essentially a confusing tautology. But they had to avoid calling it "the interface" to not give away the answer, and I'm struggling to find a better (and similarly terse) alternative. B. They're used to avoid ...


2

Engineering costs money, so open-ended statements like: run with as little hardware as possible ...are too incomplete to be stories. Running on as little hardware as possible would be the task that never ends. It may very well be the operator's goal to run on as little hardware as possible, but that is probably a local optimization. If the ...


1

This is not a user story: it’s a non functional requirement and it’s certainly common to several stories: The users communicate with the app and do not care about behind the scene and how data is transmitted. Every interaction between the app and the server is potentially impacted. The resulting optimised performance is an emerging effect of the ...


0

Many streaming services lack a story or simply information on how big the average song or movie file actually is. Many mobile devices support super high hdr, 4k or even 8k now. That´s a problem for many with limited bandwidth thus in need of smaller files you most likely encoded to jpeg/jpg. Tell everyone how much the average user save by NOT having to ...


4

You can make these valid user stories, but your need to keep them focused on benefits for the end user. For reducing the size of the payload sent to the server focus on the metrics of reducing data size tied to a metric. In order to stay within the limits of my 2 GB wireless data plan As a user on a mobile device while not connected to WiFi I ...


2

This isn't the domain of implementation, but the domain of protocol. After the protocol has been worked out, using those requirements/desired properties, then stories can be crafted to implement the expected behaviours incrementally in both the client and the server. When drafting the requirements of the protocol you will need to analyse the requirements ...


-2

So in a subclass, inherited abstract method can again go abstract without implementation , while if a class implements an interface it's method must be implemented.


5

If I'm understanding correctly, you want to support some operations on the inner array, but not others. If this set of supported operations is general enough for a D2ArrayWrapper to make sense, then I would suggest using an interface. For example, let's say you want people to be able to read cells and rows from the array, but not write them: interface ...


1

Your question is very general. So will be my answer. The easiest way would be to write the implemented method to cover the special cases. It it's complex, you may delegate the execution to more specialised function (that can be outside the interface). But if it were that simple you wouldn't probably ask. Another way could be : to implement your ...


0

The method that implements the interface will do exactly what the code that you put into the method does. So if you want the instances of your class to do something different when the interface method is called, you just do it. Some interface methods are explicitely defined to work that way. For example, in iOS a UIViewController has an interface method ...


2

The generic type will have the actual types used in the code added at compile time. Here you are confusing Method and class generic types public class B { } public class C { } public class D { } public class E { } public class A : IRetrievable<B, C> //interface not implemented!! { public TValue Retrieve<TKey, TValue>(TKey input) { ...


1

Use composition instead. Pass implementations of your two interfaces as parameters into the constructor of your class, and assign each one to an IRetrievable<T, K> member of your class. Alternatively, inherit from a dual interface: public interface IDualRetrievable { IRetrievable<T, K> Retrievable1 { get; set; } IRetrievable<T, K>...


2

It seems to me like the fundamental problem you are getting at is the need to generate the Message objects as you call methods/fields on your Domain objects. There's not much you can do about this if you want to do Event Sourcing. If you keep the simple ItemRepository, then when you call Save(Item) the underlying event source database has no way to work out ...


0

This comes down to the question of Why do we abstract anyways? The point of abstraction is to do more with less. When you see code as rules like don't talk to men you don't know who wear dark suits and black hats and don't talk to strangers you have two rules, the latter being more abstract than the former. So you end up with an abstract rule having ...


2

As a general principle, you should use the smallest amount of information necessary. In your example, if Orange implements the interface Fruit, and if your code works fine without the knowledge that the object is an Orange object, then it should be declared as a Fruit interface. This means there is no need to change anything if you want to have a ...


3

The coupling here happens between Orange and the rest of your program. If you retain an instance of Orange, then you could conceivably call method specific to Orange and not of Fruit. This is bad for two reasons: A) using methods specific to Orange means you could not act on that instance simply as a Fruit instance (violates Liskov Substitution Principle),...


Top 50 recent answers are included