Jump to content

Recommended Posts

Posted

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?

Posted

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.

  • Like 5
Posted

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?

  • Like 1
Posted
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 ?

Posted

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.

  • Like 1
Posted

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 ?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...