In this thesis, we show how challenges in parallel and distributed systems can be overcome for specific applications, chosen from different application domains and with different characteristics. The first domain is high-performance computing, where we applied a dataflow-based programming model to stencil computations. The second domain is real-time embedded computing where we improved middleware support for dataflow models, focusing on optimizing schedules of applications on MPSoCs. The third domain is ubiquitous computing, where we apply dataflow-based modeling and optimization techniques, in order to deploy applications in ubiquitous environments.Our results show that programming stencil operations with dynamic task graphs reduces their ...