Common MistakesCommon Mistakes
MVC ArchitechtureMVC Architechture
MVC Key FeaturesMVC Key Features
MVC Business logicMVC Business logic
Coding Guidlines For API Creation
Joomla MVCJoomla MVC
Coding RequirementsCoding Requirements
API WorkflowAPI Workflow
API RequirementAPI Requirement
Common Mistakes
● Avoid MVC architecture in code
● Code redundancy / repetition
● Complex and bulky code writing
● Continuous code
● Forget to write optimise code
● Forget comments
MVC Architecture
Controller
View Model
Key features
● Business logic
● DRY coding style
● Smart code
● Optimize
● Easy to maintain
● Uniqeness
Business logic
● Process of calculating logical process
● Process code
● Execution time
● Optimized code
Joomla:MVC frame Structure
● Componenet
- View
- Module
- Helpers
- Includer/libraries
- Tables
● Template
Coding Requirements
● Write upto 50-60 line
● Do not write same code in many files.
● If slighty diffrent code, use condition in code avoid
repeatation
● Avoid more complexity
● Make it simple
● Optimize code
● Writen code must be readable
● Place in proper place
- means queries in model
- common function in helpers/includes/libraries
● Avoid to return full data on view.
API work flow
App / Site
API Helpers
Models
Libraries
Database
API Requirements
● Core functions in use
– Helpers/Libraries/Includes
– Module
– Use controller code if requirement
– Write query to get data
Questions....?
Thanks

Api code requirement