Design Principles
From Nephtali Documentation
Contents |
Architecture
One of the prime objectives of Nephtali was to provide the flexibility to work with an existing site as-is. You can add Nephtali to a site of any type of structure using any javascript framework without issue. Nephtali accomplishes this through its unique architecture.
Directory structure
To add dynamic capabilities to a web page anywhere in your site, you merely add a Nephtali file to the nsite directory that parallels the location of the html file. For example, if you want to make your homepage, index.php, dynamic, add a Nephtali file called index.php to the nsite directory. Nephtali's directory structure allows you to accommodate any type of site structure.
And, if you want to add functionality to several pages or by directory, you can add the code to nregister.php.
Markup is markup
Nephtali keeps all application code cleanly separated from the markup for the site, freeing designers, front-end developers, information architects, and UX professionals from having to worry about breaking functionality or having to redo work when the site moves beyond a prototyping stage. All pages can be used as-is by Nephtali after adding a few XML comments.
I'm losing control
Typical web applications employ either of 2 types of controllers:
- Front controller
- Requests for the entire site are handled by one given object/function, handling any domain logic and then determining which view to display.
- Page controller
- The request for a particular page is handled by a given object/function, often handling any domain logic and then determining which view to display.
Issues with front and page-level controllers
The front controller can turn simple tasks into long-traveled expeditions of discovery within the framework itself. Page-level controllers typically make assumptions about the application structure.
And, both approaches require many view pages to represent all of the possible states of a particular page and its dynamic content.
Nephtali takes a novel approach
- Pipe controller
- Each dynamic region of the page (in Nephtali, a dynamic region is referred to as a pipe) has it's own controller, and the views are embedded within comment-delimited regions of the HTML page.
This approach fosters autonomy for front-end developers, designers, and UX professionals, as they can see the page and all of its potential states within one file, completely control the markup for each state, and avoid worrying about whether the site structure conflicts with the framework.
Developers also benefit. They can focus on the logic of the application in the Nephtali file, easily reuse functionality, and accommodate all of the possible states of the page with ease within one file.

