# |
Nov 19th 2019, 10:19 |
challgren |
Are you connecting to an API or providing a framework for an API? |
# |
Nov 19th 2019, 10:19 |
neon1024 |
There is also a JsonApiListener for Crud now too if you want a more verbose JSON standard api |
# |
Nov 19th 2019, 10:18 |
neon1024 |
Perhaps :point_right: http://www.bravo-kernel.com/2015/04/how-to-build-a-cakephp-3-rest-api-in-minutes/ |
# |
Nov 19th 2019, 10:18 |
neon1024 |
Have you looked at any of the existing API plugins? |
# |
Nov 19th 2019, 10:17 |
kgb.acct.personal |
I'm not that exposed to different design patterns so I'm looking at Cake source |
# |
Nov 19th 2019, 10:17 |
kgb.acct.personal |
IDK what design pattern to use |
# |
Nov 19th 2019, 10:17 |
kgb.acct.personal |
I'm planning to make an API client library/plugin |
# |
Nov 19th 2019, 10:16 |
dereuromark |
mainly typesafe and IDE autocompletable DTOs, yeah. |
# |
Nov 19th 2019, 10:16 |
neon1024 |
@kgb.acct.personal Any specific pattern that you’re looking for? Are you looking to sell CakePHP to a manager for a project? |
# |
Nov 19th 2019, 10:15 |
neon1024 |
Er, DTO right? |
# |
Nov 19th 2019, 10:15 |
neon1024 |
Or use @dereuromark plugin for true data object pattern |
# |
Nov 19th 2019, 10:15 |
neon1024 |
Entity pattern for data transfter |
# |
Nov 19th 2019, 10:14 |
dereuromark |
Stateless vs stateful :slightly_smiling_face: |
# |
Nov 19th 2019, 10:14 |
neon1024 |
Maybe some pattern around email? |
# |
Nov 19th 2019, 10:14 |
dereuromark |
But some are necessary |
# |
Nov 19th 2019, 10:14 |
dereuromark |
and avoiding singleton where possible :slightly_smiling_face: |
# |
Nov 19th 2019, 10:14 |
neon1024 |
Repository pattern |
# |
Nov 19th 2019, 10:13 |
neon1024 |
Cake uses Registries quite a bit |
# |
Nov 19th 2019, 10:13 |
dereuromark |
some factory pattern is used inside of the locators. some other ones somewhere else. of course. |
# |
Nov 19th 2019, 10:12 |
kgb.acct.personal |
so, it really depends on the usage? |
# |
Nov 19th 2019, 10:12 |
kgb.acct.personal |
i'm looking for actual use case of patterns |
# |
Nov 19th 2019, 10:12 |
dereuromark |
then there is e.g. "bail early" pattern, "prevent exceptions" for workflow and so on and so on |
# |
Nov 19th 2019, 10:11 |
dereuromark |
depends on the specific type of class. a normal framework uses quite a few. many even. |
# |
Nov 19th 2019, 10:11 |
dereuromark |
why do you ask? |
# |
Nov 19th 2019, 10:11 |
kgb.acct.personal |
Something like builder pattern, singleton, etc |
# |
Nov 19th 2019, 10:11 |
kgb.acct.personal |
Sorry I don't know the correct term |
# |
Nov 19th 2019, 10:11 |
dereuromark |
depends always how you look at it, and at what level |
# |
Nov 19th 2019, 10:10 |
dereuromark |
what kind of question is that? can you be more specific in terms of what pattern you mean? |
# |
Nov 19th 2019, 10:09 |
kgb.acct.personal |
I mean the internal code |
# |
Nov 19th 2019, 10:09 |
challgren |
https://book.cakephp.org/3/en/intro/conventions.html |
# |
Nov 19th 2019, 10:09 |
pieceof |
mvc prg ? |
# |
Nov 19th 2019, 10:08 |
kgb.acct.personal |
What design pattern does CakePHP use? |
# |
Nov 19th 2019, 10:00 |
neon1024 |
You can implement methods in controllers using Crud, and it’ll execute your controller method |
# |
Nov 19th 2019, 09:46 |
noel |
Hi all. I'm working with friendsofcake/crud and jsonapi. I have a desire to create an action on a controller, which is intended to do a custom query lookup. I'm struggling to figure out how to implement this within the CRUD ecosystem. Would I have to create a custom CRUD action class and then load that as a component? Or can I just add an action function to my controller (in which case how do I make it work with crud / jsonapi)? |
# |
Nov 19th 2019, 09:43 |
slackebot |
!tias |
# |
Nov 19th 2019, 09:43 |
slackebot |
Command sent from Slack by challgren: |
# |
Nov 19th 2019, 09:43 |
dereuromark |
Try it yourself with some dangerous snippets and see. |
# |
Nov 19th 2019, 09:42 |
dereuromark |
Jep |
# |
Nov 19th 2019, 09:41 |
mehov |
> if you dont use custom query snippets that means modifying the sql directly, as opposed to using the framework-provided e.g. find or where methods, right? |
# |
Nov 19th 2019, 09:39 |
dereuromark |
If u use my tools plugin you have basic trim. That usually suffices if you dont use custom query snippets. In those cases u need more. |
# |
Nov 19th 2019, 09:37 |
dereuromark |
No it is just a wrapper. Nothing else. |