Progettare software sostenibile: attori e buone pratiche
Progettare software sostenibile: attori e buone pratiche
event 11/05/2023

Quanto CO2 produce l'invio di una email?
Questa è una delle questioni che Stefano Forti, Ricercatore e Assistant Professor all'Università di Pisa, ci ha raccontato durante il Red Symposium, evento che organizziamo in Extra Red ogni mese.
La tematica ambientale è estremamente attuale e realizzare che ogni email che inviamo produce l'equivalente di 20 g di CO2 fa davvero impressione (penso a tutte le email che ricevo e invio ogni giorno e parte una goccia di sudore!).
Abbiamo parlato di sostenibilità, ingegneria del software (ed in particolare il modello GREENSOFT), abbiamo visto un caso di studio e dato uno sguardo al quadro normativo.
È venuto fuori un bellissimo dibattito, e tra i vari argomenti che sono venuti fuori ci sono alcuni aspetti molto interessanti su cui vale la pena soffermarsi a riflettere:
- la qualità è sempre un bene: risparmiare risorse, ottimizzare software e processi, fare meglio di ieri il "solito" lavoro paga sotto ogni punto di vista, non solo quello evidente economico, ma anche ambientale
- agire dove si ha controllo: il potere in mano ce l'abbiamo tutti, e anche se spesso è piccolo questo non significa che non abbia effetto. Allo stesso modo possiamo agire sulle nostre azioni e non su altro: concentriamoci su quello che possiamo fare e facciamolo!
- la questione è estremamente complessa: viviamo in un mondo grande e interconnesso, dove le dinamiche sono intricate e le azioni di alcuni possono creare conseguenze per altri. Quello che può sembrare un modo per fare del bene può trasformarsi in un'autentica tragedia per altri (è un bene prendere un nuovo computer più performante e meno impattante sull'ambiente se quello vecchio viene buttato via in una discarica di rifiuti pericolosi in un paese povero e sfruttato? Come umanità ci abbiamo guadagnato o perso?)
Non esistono soluzioni semplici a problemi complessi, e sicuramente quello che possiamo fare è prendere una direzione e fare del nostro meglio, acquisendo consapevolezza e valutando tutte le conseguenze delle nostre azioni.
Vuoi saperne di più sul modello Greensoft?
rocket_launch Scoprilo qui
Failed to "?eval" string with this error: ---begin-message--- Syntax error in ?eval-ed string in line 1, column 702: Lexical error: encountered "u" (117), after "\"Extra\\". ---end-message--- The failing expression: ==> entitiesListJson?eval [in template "20097#20123#43230" at line 59, column 29] ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign entities = entitiesListJson?eval [in template "20097#20123#43230" at line 59, column 9] ----
1<#-- Articoli in evidenza ADT -->
2<#assign portletBackground = "bg-red-white" />
3<#list portletPreferences?keys as key>
4 <#if key=="portletBackground">
5 <#assign portletBackground=portletPreferences[key]?first />
6 </#if>
7</#list>
8
9<#assign assetCategoryPropertyLocalService = serviceLocator.findService("com.liferay.asset.category.property.service.AssetCategoryPropertyLocalService") />
10<#assign categoryService = serviceLocator.findService("it.extrared.redweb.commons.service.CategoryService") />
11<#assign assetEntryLocalService=serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService") />
12<#assign dlFileEntryService = serviceLocator.findService('com.liferay.document.library.kernel.service.DLFileEntryService') />
13<#assign otherArticles = languageUtil.get(locale, "other-articles") />
14<#assign readMore = languageUtil.get(locale, "read-all") />
15
16<#assign redSimilarJournalArticle = serviceLocator.findService("it.extrared.redweb.commons.service.SimilarJournalArticle") />
17<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
18<#assign dlAppServiceUtil = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService")/>
19
20<#assign article = "" />
21<#assign urlTitle = "" />
22
23<#assign dirtyUrlTitle = themeDisplay.getURLCurrent() />
24<#assign curPage = 1 />
25
26<#if dirtyUrlTitle?contains("redirect")>
27 <#assign namespace = "_" + paramUtil.getString(request, "p_p_id") />
28 <#assign currentUrl = "_" + paramUtil.getString(request, namespace + "_redirect") />
29 <#assign urlTitle = currentUrl?split("/")?last />
30 <#assign curPage = paramUtil.getString(request, namespace + "_cur")/>
31<#elseif dirtyUrlTitle?contains("?wkrh___tabs1=properties")>
32 <#assign last = themeDisplay.getURLCurrent()?split("/")?last />
33 <#assign urlTitle = last?substring(0, last?index_of('?wkrh___tabs1=properties')) />
34<#elseif dirtyUrlTitle?contains("?")>
35 <#assign last = themeDisplay.getURLCurrent()?split("/")?last />
36 <#assign urlTitle = last?substring(0, last?index_of('?')) />
37<#else>
38 <#assign urlTitle = themeDisplay.getURLCurrent()?split("/")?last />
39</#if>
40
41
42<#assign logfactory = staticUtil["com.liferay.portal.kernel.log.LogFactoryUtil"] />
43<#assign log = logfactory.getLog("FreemarkerLog") />
44${log.info("urlTitle: " + urlTitle)}
45
46<#attempt>
47 <#assign article = journalArticleLocalService.getArticleByUrlTitle(groupId, urlTitle) />
48<#recover>
49</#attempt>
50
51<#assign entitiesListJson = "" />
52
53<#if article?? && article?has_content>
54 <#assign entitiesListJson = redSimilarJournalArticle.getSimilarJournalArticlesWithConfig(portletPreferences, article.articleId, groupId, false, curPage?number) />
55</#if>
56
57
58<#if entitiesListJson?? && entitiesListJson?has_content>
59 <#assign entities = entitiesListJson?eval />
60</#if>
61
62<#assign noResult = languageUtil.get(locale, "no-result") />
63
64<#if entities?has_content && entities?size gt 0>
65 <section class="container-fluid bg5percent">
66 <div class="swiper container ">
67 <p class="mb-5 text-muted text-uppercase">${otherArticles}</p>
68 <div class="swiper-wrapper align-items-center pt-lg-5 mb-lg-5">
69 <#list entities?keys as k>
70 <#assign entitiesGroup=entities[k] />
71 <#if entitiesGroup?size gt 0>
72 <#list entitiesGroup as array>
73 <div class="swiper-slide">
74 <#assign urlImage = "" />
75 <#assign altImage = "" />
76 <#if array["image"]?? && array["image"]?has_content>
77 <#assign docVal=array["image"]?eval />
78 <#if docVal.url?? && docVal.url?has_content>
79 <#assign urlImage = docVal.url />
80 </#if>
81 <#assign fileEntryId = docVal.fileEntryId />
82 </#if>
83
84 <#if docVal.title?? && docVal.title?has_content>
85 <#assign altImage = docVal.title />
86 </#if>
87
88 <#assign titolo = array["articleTitle"] />
89 <#assign categories = array["categoriesString"] />
90 <#assign displayPage = array["displayPage"] />
91 <#assign assetEntryId = array["assetEntryId"] />
92 <#assign assetEntry = assetEntryLocalService.getEntry(assetEntryId) />
93 <#assign categoriesList = assetEntry.getCategories() />
94
95 <div class="col-lg-9 col-9 col-sm-9 p-0">
96 <@adaptive_media_image["img"] fileVersion=dlAppServiceUtil.getFileEntry(fileEntryId?number).getFileVersion() class="mb-4" width="100%" height="auto" alt="${altImage}"/>
97 <#--
98 <img width="100%" class="mb-4" height="auto" src="${urlImage}" alt="${altImage}" title="${titolo}">
99 -->
100 </div>
101 <div class="card-body pt-2">
102 <#if categoriesList?? && categoriesList?has_content>
103 <div class="card-subtitle text-muted">
104 <#assign categoriesString = "" />
105 <#list categoriesList as c>
106 <#assign hasProperty = categoryService.hasCategoryProperty(c.getCategoryId(), "type") />
107 <#if !hasProperty>
108 <#if !categoriesString?has_content>
109 <#assign categoriesString = c.getTitle(locale)?upper_case />
110 <#else>
111 <#assign categoriesString = categoriesString + ", " + c.getTitle(locale)?upper_case />
112 </#if>
113 </#if>
114 <#--
115 <#attempt>
116 <#assign typeProperty = assetCategoryPropertyLocalService.fetchCategoryProperty(c.categoryId?long, "type") />
117 <#recover>
118 <#if !categoriesString?has_content>
119 <#assign categoriesString = c.getTitle(locale)?upper_case />
120 <#else>
121 <#assign categoriesString = categoriesString + ", " + c.getTitle(locale)?upper_case />
122 </#if>
123 </#attempt>
124 -->
125 </#list>
126
127 ${categoriesString}
128 </div>
129 </#if>
130 <a href="${displayPage}" target="_self" title="${titolo}">
131 <h3 class="m-0">${titolo}</h3>
132 </a>
133 </div>
134 </div>
135 </#list>
136 <#else>
137 <div class="container">
138 <h2 class="m-0">${noResult}</h2>
139 </div>
140 </#if>
141 </#list>
142 </div>
143 <a data-aos="fade-right" class="pt-5 align-middle" style="display: block" href="/blog">
144 <i class="align-middle me-2 material-icons-outlined">explore</i>
145 <span class="align-middle">${readMore?capitalize}</span>
146 </a>
147 </div>
148 </section>
149</#if>