user101040: There is a directory called interfaces. I've seen usage of interface classes in other places but never understood how do they work because they're trivially just an interface and therefore do nothing by their own. Can someone explain the mechanism they work in the code?

user69852: The interfaces classes just provide API definitions.
For example the interface::Wallet class declares a virtual interfaces::Wallet::getWalletTxs() method that GUI code can call to list wallet transactions. Wallet code provides a wallet::WalletImpl class that inherits from interfaces::Wallet and provides a wallet::WalletImpl::getWalletTxs() implementation of that method.
Because of the interface definition, GUI code can call the wallet code through the interface without being linked to wallet code or even necessarily running in the same process.

101040: <p>There is a <a href="https://github.com/bitcoin/bitcoin/tree/v23.0/src/interfaces" rel="nofollow noreferrer">directory</a> called interfaces. I've seen usage of interface classes in other places but never understood how do they work because they're trivially just an interface and therefore do nothing by their own. Can someone explain the mechanism they work in the code?</p>
 69852: <p>The interfaces classes just provide API definitions.</p>
<p>For example the <code>interface::Wallet</code> class declares a virtual <code>interfaces::Wallet::getWalletTxs()</code> method that GUI code can call to list wallet transactions. Wallet code provides a <code>wallet::WalletImpl</code> class that inherits from <code>interfaces::Wallet</code> and provides a <code>wallet::WalletImpl::getWalletTxs()</code> implementation of that method.</p>
<p>Because of the interface definition, GUI code can call the wallet code through the interface without being linked to wallet code or even necessarily running in the same process.</p>
