# Towards Climate Smart Farming--A Reference Architecture for Integrated Farming Systems
## 3 MiFarm-CSA Architecture
### Mixed Farming as a Service  
The MFsS is the fourth main pillar of MiFarm-CSA whose aim is to deliver a rich suite of tools and services to the end users (farmers, agricultural companies, decision makers, regulators, supply chain actors, stakeholders and individuals) in three dimensions, namely, (a) environmental, (b) economic and (c) social. MFsS goes beyond than a conventional toolkit for farmers; it constitutes the main decision support system of the proposed architecture. MFsS serves as an integrated management software that helps farmers and growers to establish sustainable farm management practices and reach profitable crop production, by enclosing various applications and services related to conventional farming systems. The envisioned MFsS should support the following MFS applications and services: (a) the Integrated Farming Systems Economics (IFSEC), (b) the W-KES, (c) the APED, (d) the Integrated Irrigation and Fertilization Application (IIFA), (e) the NCSA, (f) the Resource Managers (ReMa) and (g) the DiMaRa. IFSEC is a critical component of MFsaS, as it provides the decision-making component of the proposed architecture. IFSEC analyses existing case-studies of well-managed MFS; develops a labor-balanced analysis based on farm surveys; develops participative approaches with groups of farmers to consider their management strategies and develop scenarios; and identifies management tools to assess MFS labor requirements and associated costs so as to facilitate integration between farms. In particular, IFSEC should abe considered as completed when it is in such position to provide (a) advanced logistics, (b) advanced financial management, (c) MFS management and (d) MFS visualizations. The IFSEC advanced logistics could include (i) labor management, (ii) machinery management and (iii) inventory management. In general, the end user should be able to register a farm by adding financial information, work task assignment per worker and cost per worker. Additionally, economic features for machinery can be included, i.e., cost per individual category task per hour or area unit. Reservation for a machine for specific hours and inventory management could be available as well. The IFSEC advanced financial management could include the management of (i) sales, (ii) expenses, (iii) assets, (iv) loans, (v) budget and (vi) transactions. The end user should be able to register sales invoices containing multiple items, while the corresponding quantity per item will automatically stored to the defined warehouse. The IFSEC MFS management could involve: (i) crop-livestock diversification per individual field; (ii) week, month, year and long-term forecasting, including temperature, wind speed and rainfall (mm). Information for pests, weeds and diseases with detailed descriptions and a list with active substances which fight or prevent them could be included as well. The IFSEC MFS visualizations will bring new dashboards with real-time data with predefined templates like usage, productivity, finances, Key Performance Indicators (KPIs) and field analytics, while the MiFarm-CSA engine will be featured to export a structured report in a user-friendly manner, such as tasks, crop production, usage, finances, cost per task, inventory and resources. The W-KES applies a collaborative service to share knowledge, experiences and innovations among the different people involved in the design and application of MFS agricultural systems. W-KES is composed by three components: (a) the W-KES semantic model, (b) the W-KES web-based application and (c) W-KES forum. The semantic model is organized in a set of triplets, \"subject\", \"predicate\" and \"object\" [98], and the triplets are interconnected. The main resources of the W-KES semantic model are (a) web pages created in a collaborative manner, (b) simulation results conducted by the MFSim, (c) best practices formed as documents, stemming from the SECF and (d) educational material and training modules coming from the PLN.