Drupal as a basis

Can Drupal be used as a framework for a larger application? Is it suitable for developing a large application within its framework, or is there a limitation?

I want to use Drupal as a framework in my application. Is it worth it?

+6
source share
4 answers

It really depends on the needs of your application. Drupal, being flexible and extensible, is first a CMS and comes with features that may or may not be desirable for a web application. But if the plug-in or add-ons provide greater compliance with the more classic web application features (e.g. user management, content management, plug-in system, theme layer, etc.), Drupal provides an excellent infrastructure to avoid re-enabling the wheel (or depending on third-party / less mature framework plugins).

Drupal as a steeper learning curve compared to most frameworks. As a platform, Drupal was created and intended for CMS. Historically, Drupal puts almost everything in the database. Now the situation is improving with a generalization of export tools and tools, such as the Function Module . In addition, unlike most frameworks, Drupal does not use MVC and is generally not object oriented.

+3
source

If you're looking for a snippet development , Drupal is probably not the right choice. If you are looking for a website development kit, Drupal is probably the right tool.

People often say that Drupal is CMF, where F stands for Framework, but in fact Drupal is just a flexible CMS.

At a high level, the structure of web applications is divided into two categories: MVC and CMS. Model View Controller is what most people call a framework. CMS is simply a flexible CMS with application development capabilities.

In practice, what Drupal lacks is:

  • Proper architecture. Most of the things in Drupal developed organically; causing inconsistency, unexpected behavior, and unexpected barriers. Not to mention that Drupal is not built properly: just say that it was not designed: in general.
  • The principle of least surprise. Many structures allow qualified developers to create sites in a few hours. With Drupal, you need to gain a lot of experience and best practices before you can be sure to expose your websites when planning.
  • MVC Drupal has a separate database layer and a theme layer (view), but they are unconventional and often misused. And, of course, not after the block diagram.
  • unopinionated behavior: the framework may force certain methodologies, libraries, or even encourage specific behavior, but should not have hard-coded / non-transitional defaults that define your final product. Or, in English: The Drupals Kernel has many default settings that determine how you intend to configure, host and structure your website, regardless of your customers needs (wishes). Modules or add-ons are often behavioral and often look embedded and / or hard-coded.
  • DRY, don't repeat yourself: Drupal is very dependent on repeating itself. Its entire thematic system depends on copying code fragments into user files and changing tidbits. Its form-overridden system requires copying large parts of the default form to user modules and changing the parts that need to be changed.

Many of these shortcomings are the main reason for the delay and smoothing of the budget, as can be seen from my experience with Drupal + 10years. Where part of the uncontrolled behavior turned out to be the most unpleasant for most projects in which I participated. Obvious simple functions or ideas prove that they occupy a significant part of the entire budget; Small details eat up development weeks; that the last 20% occupy not only 80% of the effort, but sometimes 300%.

In addition, Drupal does not follow OO patterns, which (by all accounts) are bad. There is no inheritance, not DRY practice, there is no object-oriented cartographer *) and there is no uniting practice. **).

All of this may seem negative, but in fact people manage to create good Drupalsites, despite all these β€œflaws”. This is due to the fact that for the most part they adhere to the standard Drupal defaults (if possible, if possible, add-ons that need changes, custom development when there is no other option).

*) In fact, there is; in Drupal 7 PDO was introduced, but has not yet been (yet?) used as ORM / in general.

**) In fact: all the main and many contributions have tests, but these are integration tests and a rare unit test. Integration Tests (DrupalWebTest) install a clean Drupal-codebase + database for each individual test. Your average core-testsuite, which takes more than 8 hours, is no exception. TDD is just not yet possible.

EDIT Reading your examples: Drupal is especially bad in the area of ​​"form wizards", although it has seen an improvement in Drupal 7. Another notable drawback in Drupal is the correct, programmable workflow system. There are several modules that improve or replace the simple workflow system in the kernel, but they are not easy and not effective (from the development point of view) for programs. Looks like the main features you want are among the most underdeveloped areas in Drupal

+5
source

Yes! You can use it as a frame. You want to be satisfied with some of the basic APIs, such as menus, nodes, and possibly form APIs. The menu router and access control are pretty good.

I worked on several Drupal sites that didn’t quite work because the basic requirements had little to do with CMS. Drupal is very flexible, but most suitable for content management. Of course, you can use it as some satellite CMS for some other applications. Drupal can also be used for service-driven architecture.

If you want to scale up, you can consider a structure that is more relevant for testing and testing. Drupal is the last adopter of these practices and is not mature in this area. This is what I find frustrating, especially on large sites where regression error becomes a problem. Think about Ruby on Rails if you are interested.

Good luck

Note for myself: why should I wish good luck in a software project? ... interesting.

+2
source

Drupal 8 is changing a lot.

 - It is OOP - Using Composer - Have good cache mechanism in core - RESTful in core 

So, now it can be easily used as a framework for any application. On the final web page, all methods have content. E-commerce has content. Etc.

+1
source

Source: https://habr.com/ru/post/892474/


All Articles