@@ -293,6 +293,64 @@ handle one attribute at the same time as each FindCommand can only use one predi
293
293
multiple attributes at the same time using chain test on multiple predicate. However, it is ineffective as it needs to
294
294
check multiple situation (use 1 attribute, 2 attributes, or 3 attributes).
295
295
296
+ ### \[ Completed\] Separate client and housekeeper list
297
+ In the previous iteration, both clients and housekeepers were consolidated into a single list, presenting them together.
298
+ However, this amalgamation didn't offer enhanced visualization or convenience for our intended users. Hence, we opted to
299
+ segregate the client and housekeeper lists. This adjustment aims to streamline efficiency for our target users,
300
+ specifically housekeeping company administrators, enabling easier access to clients and assignment of housekeepers.
301
+
302
+ #### How the feature is implemented
303
+ The ` UniquePersonList ` class has been transformed into a generic class. Within the ` AddressBook ` class, two distinct
304
+ lists have been instantiated: one for clients and another for housekeepers. These lists store the respective entities,
305
+ ensuring separation of concerns. Both the saving and loading functionalities now operate independently on these
306
+ segregated lists.
307
+
308
+ #### Why is it implemented this way
309
+ This approach offers improvements in both efficiency and performance. By separating clients and housekeepers into
310
+ distinct lists, interactions between these entities are minimized. This segregation enhances organization and simplifies
311
+ maintenance of the system, as each list can be managed independently without impacting the other.
312
+
313
+ #### Alternatives considered
314
+
315
+ ##### Alternative 1
316
+ Store clients and housekeepers together in a single list on the hard disk, they are separated upon application startup.
317
+ Although this method is functional, it introduces overhead by requiring filtering of the single list to achieve
318
+ eparation, potentially impacting performance negatively. Furthermore, the code complexity increases as it must handle
319
+ the filtering process, making maintenance more challenging.
320
+
321
+ ### \[ Completed\] Delete feature with Type
322
+
323
+ In the previous iteration, both clients and housekeepers were contained within a singular list, limiting the delete
324
+ functionality to operate solely within this unified list. In the current iteration, we've segregated these entities into
325
+ distinct lists—one for clients and another for housekeepers. Consequently, we've introduced an updated Delete feature
326
+ capable of removing entries from either of these individual lists.
327
+
328
+ #### How the feature is implemented
329
+
330
+ Two subclasses, namely ` DeleteClientCommand ` and ` DeleteHousekeeperCommand ` , have been developed as subclasses of the
331
+ abstract class ` DeleteCommand ` . Each subclass is designed to operate on its respective list. During parsing, the system
332
+ now evaluates the type specified within the Delete command entered by the user. If the type is identified as "client",
333
+ the parser returns a ` DeleteClientCommand ` , enabling deletion of the client identified by the index within the client
334
+ list. Conversely, if the type is recognized as "housekeeper", a ` DeleteHousekeeperCommand ` is utilized to remove the
335
+ housekeeper at the specified index within the housekeeper list.
336
+
337
+ Here is how the activity diagram looks like: <br >
338
+ ![ DeleteActivityDiagram] ( images/DeleteActivityDiagram.png )
339
+
340
+ #### Why is it implemented this way
341
+ The existing implementation now employs two distinct subclasses: ` DeleteClientCommand ` and ` DeleteHousekeeperCommand ` ,
342
+ each tailored for deleting entries from their respective lists. By segregating these functionalities into separate
343
+ classes, the code adheres more closely to object-oriented programming (OOP) principles, enhancing clarity and
344
+ maintainability. This approach ensures that each command operates distinctly on its designated list, promoting a more
345
+ organized and modular codebase.
346
+
347
+ #### Alternatives considered
348
+
349
+ ##### Alternative 1
350
+ Introducing a new attribute, "Type", within the ` DeleteCommand ` class may effectively accomplish the task at hand;
351
+ however, it also brings the drawback of potentially increasing the number of conditional statements, which could degrade
352
+ readability and maintainability. Moreover, the internal nature of the "Type" attribute might obscure its purpose to
353
+ developers, leading to confusion.
296
354
--------------------------------------------------------------------------------------------------------------------
297
355
298
356
## ** Documentation, logging, testing, configuration, dev-ops**
0 commit comments