Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 20:32

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Diamond - Powerful MVC / Template Framework

Discussion on Diamond - Powerful MVC / Template Framework within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
Diamond - Powerful MVC / Template Framework

I know most of the people in this section are German speaking, but I figured I'd still present this framework here, as some of you probably would find it useful.

Diamond is a very powerful MVC / Template Framework written in the D Programming Language. It scales well for large projects.

Github:

Some of its features include:

(General)
  • Full controller over requests / responses when wanted.
  • "Websettings" file that lets you control requests and responses
  • Multiple static file paths
  • Let's you bind to multiple ip addresses and ports
  • Let's you control the default headers of each type of requests (default, static files, errors, not found etc.)
  • Uses vibe.d for backend, so it's very powerful and all vibe.d features can be used
  • Easy control over the application's type using static if constructs

(Views)
  • Views can be parsed at compile-time , thus rendering of views are super fast
  • Views can have layout views
  • Views have a metadata section that lets you change view configurations such as layout, controller, model, route and placeholders
  • Views can encode their data
  • Has a rich syntax that allows for complex and innovative rendering
  • Easy access to the current request / response using the properts: httpRequest and httpResponse
  • Can render other views within itself
  • Any type of D code can be written within views
  • Allows for sections, which is useful to only render a part of the view. (Very useful for responsive designs.)

(Models)
  • Models can be of any datatype (classes, structs, enums, scalar etc.)
  • Models are optional
  • Models can be passed around in view rendering
  • "Models" can easily be converted to json from controllers

(Controllers)
  • Controller actions are mapped through attributes
  • Controller actions can easily control how the response is handled, as they require a status returned
  • Can map mandatory actions that are executed on every requests. (Useful for authentication etc.) -- However authentication can be implemented using the attributes available for it too
  • Easy integrated authentication

(Controllers - WebServer)
  • Can access the view directly by the view property
  • Can easily return json data either by return models that are serialized as json or by composing json strings.
  • Can easily redirect by calling redirectTo()

(Controllers - WebApi)
  • Can access the request, response etc. directly

FAQ

What is Diamond?

Diamond is a MVC / Template library written in Diamond. It was written originally as an alternative to the Diet templates in vibe.d, but now its functonality and capabilities are far beyond templating only.

What does Diamond depend on?

Diamond can be used stand-alone without depending on any third-party libraries, other than the standard library Phobos. It has 3 types of usage, websites and webservices, where it's used on-top of vibe.d and as a stand-alone mvc/template library.

What is the dependency to Vibe.d?

Diamond was originally written to be used in a hobby project as an alternative syntax to the "standard" diet templates. Thus it was originally build on-top vibe.d as a pure website template. It has now evolved to be able to run stand-alone however.

What syntax does Diamond use?

Diamond is heavily inspired by the ASP.NET Razor syntax, but still differs a lot from it. You can read more about that in the wiki under Syntax Reference or the comparison with ASP.NET Razor

What advantage does Diamond have over Diet?

It let's you control the markup entirely, can be integrated with any-type of D code, not limited to vibe.d and can be used as standard template library for any type of project such as email templates etc. It also allows for special rendering, easy controller implementations and management of request data, response etc.

Another advantage is that Diamond is very light-weight when used standa-lone; where Diet depends on vibe.d and to use it you must have the whole library referenced.

Does Diamond parse on every request like ex. PHP?

No. Views are parsed once during compile-time and then compiled into D code that gets executed on run-time; keeping view generation to a minimum, while performance and speed is kept high. The downside of this is that on every changes in code you'll need to recompile. However it's recommended to setup an environment that checks for changes and then simply recompiles when changes are found. On Windows this can be done with or if you don't mind .NET you can use (Not sure about *nix systems as I have very little experience with those.)

In the future (At least for Windows as a starter) an application will be developed that can be used to automate build-processing etc.

View the repository Cryztal for more information.

What are some main features of Diamond?

Please view the feature section above.

Is it easy to use Diamond?

Diamond has been made in a way that it's very easy to use and integrate into projects. It also takes care of all background setup for vibe.d projects, letting you focus on just writing your websites / webservices logic, rather than a huge hassle of setup.

Are there any syntax guide-lines?

The wiki has two syntax guide-lines one for the specific syntax of Diamond and one that compares it with ASP.NET Razor.

Thank you, that's all!
Super Aids is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Shaiya mvc framework website
07/01/2016 - Shaiya PServer Development - 0 Replies
Hello I would like to start a new project for shaiya servers. But I would like some input first before I start. The project will be a website built on bootstrap framework. Reason? So your players can access there account via cell/tablet. What I want to ask is what do you think the website should have in it? Should it use a separate login other than game? Should it have an item mall? Etc No bashing or hating I'm just trying to give back to the community.
[RELEASE] Alexya Framework - Lightweigh PHP Framework
07/13/2015 - Coding Releases - 2 Replies
Hi! I've just finished a framework I was working on and decided to release it. I'll put the github link over here: https://github.com/manulaiko/alexya and you'll check it, once I get back home I'll post a tutorial. See you!
Infy - The extended easy to use MVC-Framework
07/05/2015 - Coding Releases - 0 Replies
http://i.epvpimg.com/y9Cid.png Moin Leute, ich will euch heute mal OfficialiSeven's kleines und feines MVC-Framework vorstellen welches in PHP geschrieben worden ist. Aktuelle Funktionen: Routing Named-Parameters (kennen evt. einige von Ruby on Rails)
[Development] Darkstar CMS - 2014 ~ MVC, Framework, MySQLi
11/30/2014 - DarkOrbit - 12 Replies
Hi, good afternoon elitepvpers... MY NAME IS: Daniel :) Note: i'm new in the Darkorbit Private Server, if u can give me the welcome i'm happy ;), i wanna help the technology of do pv servers... I'm creating a new cms and modified an emulator of darkorbit... This is the specifications of the cms:
DarkNight 1.3.2 [Bukkit][cracked] Jobs, MVC, LWC
08/26/2012 - Minecraft Server Advertising - 0 Replies
Hallo, der Bukkit-Server DarkNight mit 10 Slots braucht noch Spieler. Er ist schon seit 3 1/2 Monaten online und hat schon jede Menge nette Spieler. Es ist gibt Grundstücke und ein/e Freebuilding-Bereich/Welt. Der Server wird noch erweitert. Trailer: Der Trailer IP:



All times are GMT +2. The time now is 20:32.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.