Best Practices Flashcards

(32 cards)

1
Q

Define best practices in Symfony.

A

Guidelines that help developers create efficient, maintainable, and scalable applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or false: Symfony encourages code duplication for easier maintenance.

A

FALSE

Symfony promotes reusability and avoids code duplication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of services in Symfony?

A

To encapsulate business logic and promote separation of concerns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: Use dependency injection to manage _______ in Symfony.

A

services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define routing in Symfony.

A

The process of mapping URLs to specific controllers and actions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or false: Symfony supports RESTful APIs natively.

A

TRUE

Symfony provides tools for building RESTful services easily.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a controller in Symfony?

A

A PHP class that handles user requests and returns responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Fill in the blank: Symfony uses Twig as its _______ engine.

A

templating

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define entity in Symfony.

A

A PHP object that represents a database table and its records.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the role of Doctrine in Symfony?

A

To provide an Object-Relational Mapping (ORM) layer for database interactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or false: Symfony applications should avoid using configuration files.

A

FALSE

Configuration files are essential for setting up parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: Use annotations to define routes in _______ controllers.

A

Symfony

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does Symfony Flex do?

A

It simplifies the process of installing and configuring Symfony bundles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define form handling in Symfony.

A

The process of creating, validating, and processing user input forms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or false: Symfony encourages using PHP 7.2 or higher.

A

TRUE

Symfony requires PHP 7.2 or later for optimal performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of event listeners in Symfony?

A

To respond to specific events occurring within the application.

17
Q

Fill in the blank: Use Symfony Console for building _______ applications.

18
Q

Define security in Symfony.

A

Mechanisms to protect applications from unauthorized access and attacks.

19
Q

What is a bundle in Symfony?

A

A package of reusable code that can be shared across projects.

20
Q

True or false: Symfony promotes monolithic architecture exclusively.

A

FALSE

Symfony supports both monolithic and microservices architectures.

21
Q

Fill in the blank: Use environment variables to manage _______ settings.

A

configuration

22
Q

What is the Symfony Profiler?

A

A tool that provides insights into application performance and requests.

23
Q

Define validation in Symfony.

A

The process of ensuring that user input meets defined criteria.

24
Q

What does Twig allow developers to do?

A

Create dynamic templates with a clean syntax and built-in functions.

25
True or false: Symfony supports **internationalization** (i18n).
TRUE ## Footnote Symfony provides tools for translating messages and content.
26
Fill in the blank: Use **cache** to improve _______ performance.
application
27
What is the purpose of **logs** in Symfony?
To record application events and errors for debugging and monitoring.
28
Define **testing** in Symfony.
The practice of verifying that application code behaves as expected.
29
What is a **migration** in Symfony?
A way to manage database schema changes over time.
30
True or false: Symfony applications should avoid using **unit tests**.
FALSE ## Footnote Unit tests are crucial for maintaining code quality.
31
Fill in the blank: Use **composer** to manage _______ in Symfony.
dependencies
32
What is the **Symfony Community**?
A group of developers and users who contribute to and support Symfony.