πŸ—οΈ AppML Core Concepts & Architecture
Estimated reading: 4 minutes 28 views

βš–οΈ AppML – Client vs Server Operations: What Runs Where and Why It Matters

🧲 Introduction – Understanding AppML’s Execution Model

When building dynamic applications with AppML (Application Modeling Language), it’s important to understand which parts of your app run on the client (browser) and which ones require server-side interaction. This helps optimize performance, improve scalability, and choose the right architecture for your use case.

🎯 In this article, you’ll learn:

  • The difference between client-side and server-side operations in AppML
  • Which tasks are handled in the browser and which require backend support
  • Real examples of data fetching, form submission, and CRUD workflows
  • Best practices for balancing performance and security

πŸ’» What Is a Client Operation in AppML?

Client-side operations are handled directly in the browser using HTML and JavaScript (via appml.js). These operations do not require interaction with a server (unless data is fetched externally).

βœ… Examples of Client-Side Operations:

🧠 TaskπŸ“˜ Description
Loading local JSON/XML filesAppML fetches and renders static files
Rendering HTML templatesReplaces {{ }} placeholders with data
Filtering data (in-memory)Using appml-controller and onshow
Displaying dynamic tables/listsRendering loops over local data sets

Example:

<div appml-data="data/products.json">
  <h4>{{name}}</h4>
  <p>${{price}}</p>
</div>

βœ… This works entirely on the client, as the JSON file is fetched and processed in the browser.


🌐 What Is a Server Operation in AppML?

Server-side operations require communication with a backend script (like PHP or ASP) to fetch, update, delete, or validate data stored on a server or in a database.

πŸ” Examples of Server-Side Operations:

πŸ”§ TaskπŸ“˜ Description
Fetching MySQL recordsServer-side PHP/ASP script returns JSON
Submitting forms to update databaseRequires server validation and response
Login/authenticationMust be handled securely on the backend
Pagination for large datasetsOften done on the server for performance

Example:

<div appml-data="get_products.php">
  <h4>{{name}}</h4>
  <p>${{price}}</p>
</div>

Here, get_products.php fetches and returns data from a MySQL database, which AppML renders on the client.


πŸ”„ Comparison: Client vs Server in AppML

🧩 OperationπŸ–₯️ Client Side🌐 Server Side
Load static JSONβœ… Supported❌ Not needed
Load database recordsβŒβœ… Required (PHP/ASP)
Display list/gridβœ… Via templatesβœ… If paginated via server
Form validationβœ… Basic via controllerβœ… Strong validation
Save/update/delete recordsβŒβœ… With backend logic
Authentication/loginβŒβœ… Only on server

🧠 When to Use Server-Side with AppML

Use server-side AppML operations when:

  • Your app needs to interact with a relational database (e.g., MySQL, PostgreSQL).
  • You’re building secure forms that require validation and data sanitization.
  • Your data sets are too large to handle in-browser (e.g., 10,000+ records).
  • You need user authentication, session management, or role-based access.

⚠️ Remember: Never trust client-side data for secure operations. Always validate on the server.


πŸ“¦ AppML Controller Role – Bridge Between Client and Server

AppML controllers (appml-controller) can handle client-side logic and trigger server actions.

Example: Using Controller to Filter Server Data

myAppML.onshow = function() {
  myAppML.sqlfilter = "category='electronics'";
};

This filter is sent to the server, which modifies the SQL query accordingly.


πŸ“Œ Summary – Recap & Key Takeaways

Knowing the division of tasks between the client and server in AppML helps you structure efficient, secure, and responsive applications.

πŸ” Key Takeaways:

  • Client-side: Load static files, render templates, filter in-memory data
  • Server-side: Interact with databases, process forms, handle authentication
  • Controllers help manage logic and trigger server actions
  • Always validate data and manage sessions securely on the backend

βš™οΈ A balanced use of client and server operations is key to scalable AppML applications in 2025.


❓ FAQs – AppML Client and Server Behavior


❓ Can I build a full app in AppML without a server?
βœ… Yes, if your data is stored in static JSON or XML. You only need a server for database or form processing.


❓ When do I need PHP or ASP with AppML?
βœ… If you’re connecting to a database like MySQL or performing dynamic operations like save/delete/update, you’ll need PHP or ASP.


❓ Can AppML filter data on the client side?
βœ… Yes, for small to medium datasets. Use myAppML.filter inside a controller script to filter JSON before rendering.


❓ Is login authentication possible with only AppML?
❌ No. Authentication requires server-side scripting for security.


❓ Can I submit forms in AppML without JavaScript?
βœ… Yes, but the form’s action must point to a server-side script that handles submission and returns updated JSON.


Share Now :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

AppML – Client vs Server Operations

Or Copy Link

CONTENTS
Scroll to Top