Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Felix' Abstraction Programming Experience

Fi0x edited this page Nov 30, 2020 · 7 revisions

Goal

The main goal of our Uni-Messenger client was to provide a program that supports more than one messenger service. To accomplish that we need to access data from different APIs. It would be a lot of work to implement each function for each messenger seperately. That is why we use abstraction. Abstraction allows us to implement all the functions without worrying which messenger we use.

Implementation

To implement abstraction, we used interfaces. Each messenger gets classes that implement these interfaces. The user-functions then only need to call an interface, and can use all the methods from it for each messenger.

Steps to accomplish abstraction

  • Created interfaces for Login/out, Conversations, Data handling, Messages and other
  • Created a class to store Wire conversations and one to store Wire chat participants because these structures are different in each messenger
  • Made menues general enough so that all services can use the same menu
  • Added APIAccess class that can be called to obtain an interface class. This class always returns the right class for the current service
  • Added methods to the interfaces that will be useful for every messenger service