Python Forum

Full Version: OOP and module approaches in a simple app monitoring list of servers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

I have a simple web app (python & flask) which shows a list of Oracle databases as a list, from where we can open a page with details about individual database. Part of the information is entered manually ("owner", "comment"), some info is retrieved from the database by SQL (say "database name", "number of sessions"). The databases are periodically checked to get that info.
The list of the databases is stored in a separated Oracle database.
Let's consider there are just two pages a page with the list of databases, there is a page of individual database info which is also used to enter a new database.

You can imagine it as a very simple app monitoring a list of servers stored in a database showing their statuses and some additional info. In my case the servers are Oracle databases.

The app is done, but I am wondering how you would design it structure.

1. How would you organize this project as modules?
2. How would you organize this project in terms of OOP? I can see classes "database", "monitor", but not sure should be there class DatabaseList, should factory pattern be applied, etc
This sounds like an interview question, lol.

(Oct-31-2019, 08:10 PM)hjzxxzjcz Wrote: [ -> ]I can see classes "database", "monitor", but not sure should be there class DatabaseList
What benefit would you get from having a DatabaseList class, that you wouldn't also get from a list of databases? If you can't answer that, then you shouldn't make one.