Task: Implementation of AD functionality
Completion requirements
Opened: Sunday, 6 October 2019, 12:00 AM
Due: Sunday, 13 October 2019, 12:00 AM
The following methods have to be implemented:
+createStudent(username, nameSchoolClass)To ensure that this is done entirely in the
+deleteStudent(username, nameSchoolClass)
+createSchoolClass(nameSchoolClass)
+deleteSchoolClass(nameSchoolClass)
PyAD class, it should extend an abstract class. This is where abstract methods are declared that must be defined in the inheriting class:
Abstract class AbstractLDAP describe what subclass PyAD has to do
(If PyAD class is replaced or supplemented by another class, e.g. by using OpenLDAP or another library, the implementation rule of the abstract class ensures that the full functionality is also implemented here.)
from abc import ABC, abstractmethod # import Abstract Base Classes (ABCs)
class AbstractLDAP(ABC): # abstract class
def __init__(self, dnStudents):
self._dnStudents = dnStudents
super().__init__()
@abstractmethod # every abstract method has to be defined in subclass
def createStudent(self, username, nameSchoolClass):
pass
@abstractmethod
def deleteStudent(self, username, nameSchoolClass):
pass
@abstractmethod
def createSchoolClass(self, nameSchoolClass):
pass
@abstractmethod
def deleteSchoolClass(self, nmaeSchoolClass):
pass
from pyad import * # import installed pyad module
class PyAD(AbstractLDAP): # Task: implement these 4 methodes in subclass PyAD
def createStudent(self, username, nameSchoolClass):
...
def deleteStudent(self, username, nameSchoolClass):
...
def createSchoolClass(self, nameSchoolClass):
...
def deleteSchoolClass(self, nameSchoolClass):
...
Complete the above method definitions in groups. Each group is responsible for one!
Information sources: