Designing Sustainable Software: Actors and Best Practices

event 11/05/2023

face STEFANO FORTI

Symposium 27 April

How much CO2 does sending an email produce?

This is one of the issues that Stefano Forti, Researcher and Assistant Professor at the University of Pisa, discussed with us during the Red Symposium, an event organized by Extra Red every month.

The environmental theme is extremely relevant, and realizing that every email we send produces the equivalent of 20 g of CO2 is truly impressive (just thinking about all the emails I receive and send every day makes me sweat!).

We talked about sustainability, software engineering (specifically the GREENSOFT model), examined a case study, and looked at the regulatory framework.

A fascinating debate emerged, and among the various topics that came up, there are some very interesting aspects worth reflecting on:

  • Quality is always a valuable asset: saving resources, optimizing software and processes, doing a better job than yesterday in the "usual" work pays off in every sense, not just economically but also environmentally.
  • Act where you have control: we all have the power in our hands, and even if it's often small, it doesn't mean it has no effect. Similarly, we can act on our actions and not on others: let's focus on what we can do and do it!
  • The issue is extremely complex: we live in a large and interconnected world, where dynamics are intricate, and the actions of some can have consequences for others. What may seem like a way to do good can turn into an authentic tragedy for others (is it beneficial to get a new, more efficient and less environmentally impactful computer if the old one is discarded in a hazardous waste landfill in a poor and exploited country? Have we as humanity gained or lost?).

There are no simple solutions to complex problems, and certainly what we can do is set a direction and do our best, gaining awareness and evaluating all the consequences of our actions.

Do you want to know more about the GREENSOFT model?

rocket_launch Discover it here
Symposium 27 April
An error occurred while processing the template.
Failed to "?eval" string with this error:

---begin-message---
Syntax error in ?eval-ed string in line 1, column 718:
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>