> For the complete documentation index, see [llms.txt](https://framework.deep-web-solutions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.deep-web-solutions.com/key-concepts-and-dev-tools/object-oriented-programming.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
