vmarquez
vmarquez

Reputation: 1377

UML: Modeling php includes? How to?

I have a php application where some Web Pages are used for different purposes.

Depending on the value of one (or more) parameters being passed in the URL the page includes one or other php file with different functionality.

Let's say I have clients.php with the following code fragment:

<?php

$do=$_GET["do"];

switch($do){
    case "":
        include("clientes_display.php");
    break;
    case "addClient":
        include("clientes_add.php");
    break;
    case "displayClient":
        include("clientes_display.php");
    break;
    case "editClient":
        include("clientes_edit.php");
    break;
    case "deleteClient":
        include("clientes_delete.php");
    break;
?>

How do I model this kind of classes in an UML class diagram?

How do I model a specific instance of this class (a specific "page" resulting from being called with an specific value as ?do=displayClient)?

Upvotes: 3

Views: 261

Answers (1)

Frank Krueger
Frank Krueger

Reputation: 71013

It would seem to me that you have implemented a dispatcher:

+----------------+
| PageDispatcher |
+----------------+
| dispatch       |
+----------------+

Upvotes: 1

Related Questions