suntrop Posted October 22, 2018 Share Posted October 22, 2018 I need some extra functions to work with user's data, implement PayPal and Stripe and some other. Now I am wondering if there is any benefit using PW modules instead of just using a plain class and extending WireData? I do not need configurable modules and definitely not reuse them on another site … but perhaps later I need to hook into some methods. What do you think? Module or a simple class? Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 22, 2018 Share Posted October 22, 2018 Imho the big benefit of modules is installability. So anything reusable or more generic can be a fit for a module. Other than that I don't see much reason to use modules over just classes. Personally I'm of the opinion to keep modules just for the code needed to interface with processwire anyways. Business logic, which is not processwire specific can just as well be in a plain class the module brings with it. 5 Link to comment Share on other sites More sharing options...
suntrop Posted October 22, 2018 Author Share Posted October 22, 2018 Thanks! That sounds good and is what I was hoping for ?. I wasn't sure if there are any limits when it comes to the API features if I skip the module and just create a class. BTW … what do you mean by installability? Just being able to install something isn't worth anything on its own, is it? Do I miss something here? 1 Link to comment Share on other sites More sharing options...
flydev Posted October 24, 2018 Share Posted October 24, 2018 On 10/22/2018 at 7:38 PM, LostKobrakai said: Imho the big benefit of modules is installability. On 10/22/2018 at 9:27 PM, suntrop said: what do you mean by installability? Bump. Answer needed @LostKobrakai in before to put this damn refactoring thing on the tasks list ? Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 24, 2018 Share Posted October 24, 2018 I really meant "to be installed as module". "Being able to install something" might not matter, but how one is being able to install/configure something might indeed matter. 1 Link to comment Share on other sites More sharing options...
teppo Posted October 27, 2018 Share Posted October 27, 2018 Note: this topic was moved to the "Module/Plugin Development" subforum. "Modules/Plugins" area is intended for support threads of existing modules, and any module development related questions or discussions belong here ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now