I am trying to experiment with C++ by making a framework for Graphs. I want to segregate the framework as follow
Where Representation is an interface and distinct representations can be implemented by abstract or concrete classes i.e., Adjacency Matrix. Graph is another abstraction and distinct types of graphs can be implemented i.e., directed or undirected.
Problem: The graph that are going to be implemented might will need to implement the representation child classes i.e., add_an_edge method for adjacency matrix can/will be different for directed or undirected graph.
I am failing to identify what design pattern is the most suitable one for this. I am thinking to go with Abstract Factory Pattern, but still not sure how that will allow implementing the child classes of Representation further.
Aucun commentaire:
Enregistrer un commentaire