The Internet of Things (IoT) paradigm offers applications the potential of automating real-world processes. Applying IoT to intensive domains comes with strict quality of service (QoS) requirements, such as very short response times. To achieve these goals, the first option is to distribute the computational workload throughout the infrastructure (edge, fog, cloud). In addition, integration of the infrastructure with enablers such as software-defined networks (SDNs) can further improve the QoS experience, thanks to the global network view of the SDN controller and the execution of optimization algorithms. Therefore, the best placement for both the computation elements and the SDN controllers must be identified to achieve the best QoS. While it is possible to optimize the computing and networking dimensions separately, this results in a suboptimal solution. Thus, it is crucial to solve the problem in a single effort. In this work, the influence of both dimensions on the response time is analyzed in fog computing environments powered by SDNs. DADO, a framework to identify the optimal deployment for distributed applications is proposed and implemented through the application of mixed integer linear programming. An evaluation of an IIoT case study shows that our proposed framework achieves scalable deployments over topologies of different sizes and growing user bases. In fact, the achieved response times are up to 37.89% lower than those of alternative solutions and up to 15.42% shorter than those of state-of-the-art benchmarks.