← Back
ExamFull examExam paper onlyItalian

20230607

Study material for Ingegneria del Software, shared by the Studwiz community and reviewed by moderators.

Ingegneria del SoftwareFull exam

Document information

What's included in this study material

Study material for Ingegneria del Software, shared by the Studwiz community and reviewed by moderators.

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

Ingegneria del Software — Soluzione del Tema 07/06/2023 Esercizio 1 Si consideri la seguente classe LastHundredPosts che memorizza i post e i commenti di un nuovo social network, che mantiene solo gli ultimi 100 post di ogni utente e solo i commenti relativi a tali post. public class LastHundredPosts { // Ritorna l’insieme degli utenti del social network. public /*@ pure @ */ Set<User> getUsers() {...} // Ritorna la lista dei post effettuati dall’utente passato per parametro. // La lista contiene i post in ordine inverso di inserimento: dal piu’ recente al meno recente. // Lancia una UnknownUserException se l’utente non e’ parte del social network. public /*@ pure @ */ List<Post> getPosts(User user) throws UnknownUserException {...} // Aggiunge un post avente come autore l’utente passato per parametro. Se l’utente ha gia’ effettuato // almeno 100 post, cancella il post meno recente tra quelli attualmente salvati per quell’utente. // Lancia una UnknownUserException se l’utente non e’ parte del social network. public void addPost(Post post, User user) throws UnknownUserException {...} // Aggiunge un commento al post passato per parametro e avente come autore l’utente passato per parametro. // Lancia una UnknownUserException se l’utente non e’ parte del social network. // Lancia una UnknownPostException se il post non e’ presente nel social network. public void addComment(Comment comment, Post post, User user) throws UnknownUserException, UnknownPostException {...} // Ritorna i 10 commenti (di qualunque utente e associati a qualunque post) che hanno ricevuto piu’ like. // I commenti sono ritornati in ordine inverso di numero di like (prima quelli con piu’ like). // In caso di parita’ l’ordine non e’ specificato. In ogni caso, la lista contiene al piu’ // 10 commenti (o…

Preview

First page of the document.

First page: 20230607