0
votes
1answer
272 views

PHP class data implementation

I'm studying OOP PHP and have watched two tutorials that implement user login\registration system as an example. But implementation varies. Which way will be more correct one to work with data such as ...
2
votes
5answers
594 views

Why is TDD not working here?

I want to write a class A that has a method calculate(<params>). That method should calculate a value using database data. So I wrote a class Test_A for unit testing (TDD). The database access ...
3
votes
3answers
342 views

Architecting persistence (and other internal systems). Interfaces, composition, pure inheritance or centralization?

Suppose that you need to implement persistence, I think that you're generally limited to four options (correct me if I'm wrong, please) Each persistant class: Should implement an interface ...
2
votes
2answers
2k views

DB Object passing between classes singleton, static or other?

So I'm designing a reporting system at work it's my first project written OOP and I'm stuck on the design choice for the DB class. Obviously I only want to create one instance of the DB class ...
0
votes
2answers
135 views

Is hooking Data access method on wrong object detrimental for a developer

In a simple application I am creating there are Admin and users where admin can create users. Right now I am creating Classes that encapsulate database CRUD calls with methods. For example: ...