# Object-Oriented Programming

The DWS WP Framework is fully OOP. Support for OOP hasn’t been historically great in PHP, but it’s remarkably good in PHP7 in general and PHP7.4 in particular. And it only gets better in PHP8!

That means that most logic is encapsulated in ([namespaced](https://www.php.net/manual/en/language.namespaces.php)) classes. There is a long debate to be had about OOP vs non-OOP, but we believe that WordPress plugins are great candidates for an OOP design.

To make things predictable (and standardized), the namespace-structure follows the PSR-4 standard. You can read more about that [here](https://www.php-fig.org/psr/psr-4/) but it’s basically a convention that enforces the following things:

* One class -- one PHP file.
* The namespace structure follows the folder structure of the filesystem.
* Each namespace is of the form:

```
\<ProjectNamespace>(\<SubNamespaceNames>)*\<ClassName>
```

For example, let’s assume that:

* your project namespace is *SomeCompany\Plugins\SomePlugin*
* all your PHP files are in the *includes* folder

Then the class *SomeCompany\Plugins\SomePlugin\Admin\Settings* will be in the file *includes/Admin/Settings.php*.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://framework.deep-web-solutions.com/key-concepts-and-dev-tools/object-oriented-programming.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
