cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Data storage interface/abstract class

Open salarmehr opened this issue 13 years ago • 5 comments

RDBMSs and NoSQL DBMSs are both related to data storage and share a lot of similar operations (CRUD, validation, events, ...). Please pack share methods in a super class (e.g. Phalcon\Storage) and extend them from it. (e.g. Phalcon\Storage\Table , Phalcon\Storage\Collection, Phalcon\Storage\File, ...)

For example skipAttributesOnCreate and other similar methods should created on super class.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

salarmehr avatar Apr 27 '13 05:04 salarmehr

Such compatibility imposes significant restrictions on the use of the database and deprives the benefits of a particular storage. Yes, there is a similar operation, but the overall structure, capabilities and behavior are very different. So there is no point in creating a consistent API for SQL, NoSQL, File or Key-Value storages.

iforp avatar Apr 27 '13 08:04 iforp

@Agent-J What restriction do you mean? I said compatibility among shared features. This is a basic principle in OO design.

salarmehr avatar Apr 27 '13 10:04 salarmehr

I think we didn't understand each other. If you are talking only about the implementation of shared features, then you are right. I meant the futility of creating an identical API.

iforp avatar Apr 27 '13 14:04 iforp

Question: Why skipAttributesOnCreate and other similar methods are not available in Collection. Answer: Because that functionality is not implemented in Collection

Do you want to open a NFR for that?

ghost avatar Apr 29 '13 04:04 ghost

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

stale[bot] avatar Apr 17 '18 07:04 stale[bot]