Questions tagged [implementation]

Deals with various issues of implementation.

Deals with various issues of implementation of functions, features, languages, etc.

2196 questions
471
votes
8 answers

Gradle Implementation vs API configuration

I'm trying to figure out what is the difference between api and implementation configuration while building my dependencies. In the documentation, it says that implementation has better build time, but, seeing this comment in a similar question I…
reinaldomoreira
  • 5,388
  • 3
  • 14
  • 29
99
votes
17 answers

Room cannot find implementation

I have a problem with testing a Room database: when I run the test, I get this exception: java.lang.RuntimeException: cannot find implementation for database.TicketDatabase. TicketDatabase_Impl does not exist at…
Federico Taschin
  • 2,027
  • 3
  • 15
  • 28
81
votes
5 answers

DDD - which layer DTO should be implemented

I am learning about DDD so apologies if my question is naive. I think I need to use Local Data Transfer Object in order to display data to the users as a lot of properties are not part of any of Entity / Value Objects. However, I am not sure where…
user2105030
  • 831
  • 1
  • 7
  • 7
66
votes
9 answers

Are algorithms with high time complexity ever used in the real world for small inputs?

Let's say we have a problem where a certain algorithm, let's call it algorithm_1, solves it in time complexity of O(n^2) and another algorithm, let's call it algorithm_2, solves it in time complexity O(n), but in reality we see that for n < 1000…
Ak2399
  • 827
  • 3
  • 6
33
votes
1 answer

Which provider should be used for the Java Persistence API (JPA) implemenation

I want to use the Java Persistence API (JPA) for my web application. There are popular JPA implementations like Hibernate, Toplink and EclipseLink. What implementation is a good choise and why?
Dimitri Dewaele
  • 10,311
  • 21
  • 80
  • 127
28
votes
1 answer

How is setTimeout implemented in the javascript interpreters or timers in general?

How is a function called after a time has passed implemented in javascript or any other interpreted language? In other words, is there a loop behind in the javascript interpreter that checks all the time a list of timers, or is there any particular…
alvatar
  • 3,340
  • 6
  • 38
  • 50
28
votes
3 answers

Clarification for "it should be possible to change the value of 1" from the CPython documentation

See this link: https://docs.python.org/3/c-api/long.html#c.PyLong_FromLong The current implementation keeps an array of integer objects for all integers between -5 and 256; when you create an int in that range, you actually just get back a…
user13595466
26
votes
7 answers

Why should I use an interface when there is only one implementation class?

I'm new at programming and I'm learning Java. I was just wondering why I should use an interface when there is only one implementation class?
Qais Sahel
  • 277
  • 1
  • 4
  • 6
26
votes
2 answers

As of 2016, is there a Scheme implementation which supports 100% of R7RS (small) with no deviations?

I am willing to learn Scheme. I want to stick to R7RS since it's the last standard. However, it seems that there is a lot of fragmentation on the Scheme current implementations, and most of them staying at R5RS or part of R6RS. The only one I have…
24
votes
2 answers

private template functions

I have a class: C.h class C { private: template void Func(); // a lot of other functions }; C.cpp // a lot of other functions template void C::Func() { // the implementation } // a lot of other functions I know, that it's…
Alek86
  • 1,489
  • 3
  • 17
  • 26
24
votes
2 answers

How do I make a struct callable?

#![feature(unboxed_closures)] #![feature(fn_traits)] struct foo; impl std::ops::Add for foo { type Output = foo; fn add(self, x: foo) -> foo { println!("Add for foo"); x } } impl Fn for foo { extern "rust-call" fn…
21
votes
4 answers

Does the JVM create a mutex for every object in order to implement the 'synchronized' keyword? If not, how?

As a C++ programmer becoming more familiar with Java, it's a little odd to me to see language level support for locking on arbitrary objects without any kind of declaration that the object supports such locking. Creating mutexes for every object…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
20
votes
2 answers

In .NET, what is the internal implementation of a delegate?

I understand that a declaration of a delegate is something like this: public delegate int PerformCalculation(int x, int y); However, there must be more going on. The purpose of the delegate is to provide a pointer to a method, and to do that you…
richard
  • 12,263
  • 23
  • 95
  • 151
20
votes
6 answers

How are try/catch blocks implemented?

If an exception occurs in a try block, how is execution transferred to the catch block? This is not a C#/Java/C++ question, I'm just wondering how it works internally.
selvaraj
  • 889
  • 2
  • 16
  • 29
20
votes
6 answers

How does this implementation of std::is_class work?

I'm trying to understand the implementation of std::is_class. I've copied some possible implementations and compiled them, hoping to figure out how they work. That done, I find that all the computations are done during compilation (as I should have…
user3190123
1
2 3
99 100