In your custom module, app/code/Module/Namespace/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Ui\Component\Form" type="Module\Namespace\Component\Ui\Form" />
</config>
Then place the Form.php
in Module\Namespace\Component\Ui\
path.
Then in that file rewrite,
namespace Module\Namespace\Component\Ui;
use Magento\Framework\Api\FilterBuilder;
use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentInterface;
/**
* Class Form
*/
class Form extends \Magento\Ui\Component\Form
{
public function getDataSourceData()
{
#your code
}
}