Posts Tagged ‘MVC’
If you love beautiful code and believe that development must be enjoyable, you’ve come to the right place. Let me introduce you Laravel, a web application framework of new generation. Don’t be skeptical, because it deserves to be noticed.
Laravel has become one of the most popular PHP framework. Laravel has changed the way many people write PHP for the better. It is a powerful MVC PHP framework, designed for developers who need a simple and elegant toolkit to create beautiful web-apps using elegant and expressive syntax. Currently, it is the most starred PHP project on Github and a lot of companies (including Altabel Group) and people all over the world use it to build amazing applications. In 2015 sitepoint.com conducted a survey to find out the best PHP-framework for developers. Laravel won in nomination of Enterprise Level Framework and Personal Project Framework.
You are here because you want to start your project on Laravel, and don’t know what course to take, right? Let’s get started.
Every framework has its own version history – it’s being maintained and updated. So every new version brings new functionality, some functions are changed or deprecated.
Laravel was created by Taylor Otwell in 2011.
- Laravel 1 was made available in June, 2011. It lacked support for controllers that prevented it from being a true MVC framework.
- Three month later Laravel 2 was released, bringing various improvements from the author and community. As a result Laravel framework became fully MVC-compliant.
- Laravel 3 was released in February 2012 with a set of new features including the command-line interface (CLI) named Artisan.
- Laravel 4, codenamed Illuminate, was released in May 2013. Laravel 4 version was the one which brought big popularity to Laravel framework, but it’s not updated anymore, and also it lacks a lot of functions released in Laravel 5.
There is an important term – LTS version, which stands for Long Term Support. It means that bug fixing for that version is to be provided within 2 years, until the next LTS version is released. For non-LTS versions bug fixing will take only 6 months, unless it’s a security fix which is carried out within1 year after a release date.
The first version to have that status is Laravel 5.1 (June 2015). According to the roadmap released by framework author, there should be a new subversion every half-year: Laravel 5.4 – Winter 2016, Laravel 5.5 – Summer 2017.
It’s quite important to know which version you will be using for your projects. For new ones it’s not advised to use Laravel 4.x version – you should use Laravel 5.x, probably Laravel 5.3 as the newest version at the time of writing this.
- The Laravel framework has a few system requirements: PHP >= 5.6.4, OpenSSL PHP Extension, PDO PHP Extension, Mbstring PHP Extension, Tokenizer PHP Extension, XML PHP Extension. This whole component kit’s presented in Windows OpenServer. Also make sure you have installed Composer on your machine.
- Here are the framework’s main features: bundles, eloquent ORM (object-relational mapping), query builder, application logic, reverse routing, restful controllers, class auto loading, view composers, blade templating engine, IoC containers, migrations, database seeding, unit testing, automatic pagination, form request.
- Using Laravel you can complete massive common tasks such as database migrations, queuing, authentication, routing, sessions, and caching with simplicity.
- Laravel has made processing with database very easy. It currently supports following databases – MySQL, Postgres, SQLite, SQL Server.
If you are familiar with HTML, Core PHP and Advanced PHP; Laravel will make your task easier. It will save you lots of time when you are developing a website from scratch. The website built in Laravel is also secure. It prevents the various attacks that can take place on websites.
Laravel offers a robust set of tools and an application architecture that incorporates many of the best features of frameworks like CodeIgniter, Yii, ASP.NET MVC, Ruby on Rails, Sinatra, and others. Laravel is built using Symfony, Doctrine, Faker, Carbon and other libraries. All of these components work flawlessly with Laravel.
1. Flexibility – there are many ways to complete one task.
2. Excellence – Laravel is the result of a long-term commitment to excellence, best practices, use of solid design principles, and the steady vision of the Taylor Otwell.
3. Evolution – each new Laravel version brings us more and more the new features which are worth trying.
4. Documentation – Laravel has beautifully written and comprehensive documentation. The Laravel forum also has many answers to common problems.
5. Official Packages – The Laravel framework has a number of extremely useful packages that we can add via composer that extend the framework.
Everything has its failings. And Laravel is not an exception.
1. Syntactic sugar – there is too much syntactic sugar in Laravel. Often you can face difficulties trying to maintain a unique build for your project code.
2. Juniors – Laravel attracts lots of newbies who can’t even cope with essentialities: framework documentation, composer and automatic loader.
3. Taylor Otwell – Why? Is it a real minus? Taylor alone determines framework future, e.g. he’s closed issues on Github, or he demands from developers to describe bugs through pull request, and so on. Yes, it’s okay from one side. But from the other – it’s not an open source.
- Forums. It’s the most common way to find an answer to about any problem.
- Podcast. You generally get a behind the scenes look at what’s coming down the road.
- Laracon. Laracon is a conference centered around the Laravel framework, covering its development, uses, and related general software development practices. Laracons are taking place in both United States and Europe, organized primarily by UserScape with additional help provided by a number of sponsors.
I recommend to anyone who wishes to learn the framework to get acquainted with above mentioned resources. It’s worth your time to do it.
I hope that this little introduction to the world of Laravel has shed some light and help you get some insights about it.
Laravel is an awesome framework to work with. It focuses on simplicity, clarity and getting work done. It’s designed to help you get started on building your own apps with Laravel. And Altabel Group will be happy to assist you with it. Remember, coding with Laravel is coding with elegance.
If you have any questions or comments, be sure to post them below and I’ll do my best to answer them!
Thank you for reading.
Business Development Manager
Professional Software Development
Introducing ASP.NET Core:
ASP.NET Core is a new open-source and cross-platform framework for building modern cloud based internet connected applications, such as web apps, IoT apps and mobile backends. ASP.NET Core apps can run on .NET Core or on the full .NET Framework. It was architected to provide an optimized development framework for apps that are deployed to the cloud or run on-premises. It consists of modular components with minimal overhead, so you retain flexibility while constructing your solutions. You can develop and run your ASP.NET Core apps cross-platform on Windows, Mac and Linux. ASP.NET Core is open source at GitHub.
The framework is a complete rewrite that unites the previously separate ASP.NET MVC and Web API into a single programming model.
Despite being a new framework, built on a new web stack, it does have a high degree of concept compatibility with ASP.NET MVC.
ASP.NET Platform exists for more than 15 years. In addition, at the time of System.Web creation it contained a large amount of code to support backward compatibility with classic ASP. During this time, the platform has accumulated a sufficient amount of code that is simply no longer needed and is deprecated. Microsoft faced a difficult choice: to abandon backward compatibility, or to announce a new platform. They chose the second option. At the same time, they would have to abandon the existing runtime. Microsoft has always been a company focused on creation and launch on Windows. ASP.NET was no exception. Now the situation has changed: Azure and Linux occupied an important place in the company’s strategy.
The ASP.NET Core is poised to replace ASP.NET in its current form. So should you switch to ASP.NET Core now?
ASP.NET Core is not just a new version. It is a completely new platform, the change of epochs. Switching to ASP.NET Core can bring many benefits: compact code, better performance and scalability. But what price will be paid in return, how much code will have to be rewritten?
.NET Core contains many components, which we are used to deal with. Forget System.Web, Web Forms, Transaction Scope, WPF, Win Forms. They no longer exist. For simple ASP.NET MVC-applications changes will be minor and the migration will be simple. For more complex applications, which use a great number of .NET Framework classes and ASP.NET pipeline situation is more complicated. Something may work and something may not. Some part of the code will have to be rewritten from scratch. Additional problems may be caused by WebApi, because ASP.NET MVC subsystems and WebAPI are now combined. Many libraries and nuget-packages are not ready yet. So, some applications simply will not have a chance to migrate until new versions of the libraries appear.
I think we are waiting for the situation similar to the transition from Web Forms to ASP.NET MVC. ASP.NET Framework will be supported for a long time. First, only a small amount of applications will be developed on ASP.NET Core. Their number will increase, but sooner or later everyone will want to move to ASP.NET Core. We still have many applications running on the Web Forms. However, no one comes to mind to develop a new application on the Web Forms now, everybody chooses MVC. Soon the same happens to ASP.NET Framework, and ASP.NET Core. ASP.NET Core offers more opportunities to meet modern design standards.
The following characteristics best define .NET Core:
- Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide.
- Cross-platform: Runs on Windows, macOS and Linux; can be ported to other OSes (Operating Systems). The supported OSes, CPUs and application scenarios will grow over time, provided by Microsoft, other companies, and individuals.Command-line tools: All product scenarios can be exercised at the command-line.
- Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard Library.
- Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses. Documentation is licensed under CC-BY. .NET Core is a .NET Foundation project.
- Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support.
- As for the “cons” one of the biggest issues are gaps in the documentation. Fortunately most of the things for creating and API are covered, but when you’re building an MVC app, you might have problems.
- Next problem – changes. Even if you find a solution to your problem, it could have been written for a previous version and might not work in the current one. Thanks to open source nature of it, there is also support available on github. But you get same problems there (apart from searching).
- Another thing is lack of support in the tooling. You can forget about NCrunch or R# Test Runner. Both companies say they will get to it when it gets more stable.
- ASP.NET Core is still too raw. Many basic things, such as the Data Access, is not designed for 100%. There is no guarantee that the code you are using now will work in the release version.
- It’s modular. You can add and remove features as you need them by managing NuGet packages.
- It’s also much easier and straightforward to set up.
- WebApi is now part of the MVC, so you can have class UserController, which will return a view, but also provide a JSON API.
- It’s cross-platform.
- It’s open-source.
ASP.NET Core is the work on the bugs of the classic ASP.NET MVC, the ability to start with a clean slate. In addition, Microsoft also aims to become as popular as Ruby and NodeJS among younger developers.
NodeJS and ASP.NET have always been rivals: both – a platform for backend. But in fact, between them, of course, there was no struggle. The new generation of developers, the so-called hipster developers, prefer Ruby and Node. The adult generation, people from the corporate environment, are on the side of .NET and Java. .NET Core is clearly trying to be more youthful, fashionable and popular. So, in future we can expect the .NET Core and NodeJS to be in opposition.
In its advertising campaign, Microsoft is betting on unusual positions for it: high performance, scalability, cross-platform. Do you think that ASP.NET “crawls” on the territory of NodeJS? Please feel free to share your thoughts with us.
Thank you in advance!
Business Development Manager
Professional Software Development
In our blog we’ve been talking a lot about best PHP frameworks, and many of them in particular: Yii, Symfony, Kohana. There are still lots of them, for sure, but today I’m going to focus on one of the most long-living and simplest ones – CodeIgniter or simply put-CI.
A piece of dry facts about CodeIgniter:
CodeIgniter is an open source rapid development web application framework, for use in building dynamic web sites with PHP. The first public version of CodeIgniter was released on February 28, 2006, and the latest stable version 2.1.3 was released October 8, 2012.
The two things that immediately strike the eye here are simplicity and a huge community. But the one important thing here to remember: if you’ve still decided to develop a big and complicated application on CodeIgniter, you will not be able to find lots of things to implement the needed functionality. Thus, we have defined the main CI’s advantage-its simplicity.
At the same time besides simplicity there’re observed lots of other advantages. Have a look at them below.
1. Simple to learn. If to compare CodeIgniter with alternative solutions, it is safe to say it’s the simplest one. Besides well-thought project architecture, developers didn’t dabble and provided perfect documentation. Really, CI’s documentation is detailed, well-structured and is updated operatively.
2. Security. Problems in the security system are inherent to every web-project, though with CI many of them are solved automatically. For instance, there is a special function for accurate filtering the received data for XSS, which allows not only deleting dangerous data but saving them into log. This is very convenient.
3. Extendability. CI is a very flexible and extendable framework. It’s a piece of cake to make the framework do new things. You just need to plug in a required helper/library/plugin and to rejoice the new functionality.
4. Rich possibilities. Together with CI there are delivered libraries, plugins, helpers that allow solving the tasks right away without reinventing the wheel. You don’t have to dig the code, it’s enough to use a special mechanism that will let you “rehabilitate” CI.
5. Active Record. In CI there is used a modified version of the pattern Active Record Database. With the help of Active record work with the database turns into a pure pleasure. You don’t have to write the endless “SELECT” for choosing the data, it’s enough to use the class’s methods which is only two small lines of code. Besides a simplified access to a DB, this class allows to forget about used DBMS. You can build an application using MySQL, and then launch it easily on Oracle. Moreover, AR allows (though a bit) to secure work with DBMS, as while framing queries all values are shielding.
6. High productivity. Such big possibilities haven’t influence CI’s productivity. It works really fast. Such high-speed performance is achieved because of a very “light” core. All additional libraries are plugged in only when needed.
7. MVC architecture. CI uses MVC (Model-View-Controller) architecture that allows separating logics from the image. While working in the team (programmers+designers), such approach will be in a high demand.
8. Support of a template system. Although using template system is not compulsory in CI, it is still can be used if you’d like to.
9. Search engines friendly. Due to its URLs, CodeIgniter is super friendly to search engines and is subject to indexation.
I believe the other PHP frameworks reviews are on their way. In the meantime, if I’ve missed something in the list, feel free to comment!
Business Development Manager
Professional Software Development
When selecting a web application framework for a particular development project, it’s very important to compare and consider the advantages and disadvantages of the different frameworks that are available. With so many PHP based web application frameworks, it can be difficult to choose one. For this blog post I’ll be focusing on a very promising PHP based web application framework Kohana.
Kohana is a PHP 5 framework that uses the Model View Controller (MVC) architectural pattern. It provides a rich set of components for building web applications. Its main purpose is to be safe, simple and easy to use, and so it is.
A little of history
Kohana was created as a branch of the PHP framework CodeIgniter. It was originally known as the Blue Flame. The main reason for “splitting” into two separate projects was a shift to a more open to the public development model due to the fact that many people were unhappy with the speed of development and fixing errors in CodeIgniter. Rick Ellis – creator and owner of CodeIgniter – was happy to see a fork of his project, but refused to help. He pushed a new project to create its own documentation and advised to rename the project. In July 2007 Blue Flame was renamed into Kohana to avoid copyright problems in the future. Developers began to look through the dictionaries of Native Americans to select a word that doesn’t violate copyright rights. Finally the name “Kohana” was chosen which in Sioux language means “swift”, which is absolutely true about this framework.
Why Kohana is an awesome framework
Although Kohana reuses many common design patterns and concepts, there are some things that make Kohana awesome and stand out. These are the most important of them:
1. Quick and easy development process. Kohana is really a very fast framework. With it you may build applications easily and quickly. There are many common components such as translation tools, database access, code profiling, encryption, validation, and more. Extending existing components and adding new libraries is very easy. While benchmarking a framework is hard and rarely reflects the real world, Kohana stands out as it is very efficient and carefully optimized for real world usage.
2. Community manageability. What is great about this framework is that it is community, not company, driven. Kohana development is driven by a team of dedicated people that need a framework for fast, powerful solutions. There exists a very active community forum and IRC (Internet Relay Chat) channel means that most questions are answered very quickly. Moreover, as it uses the BSD license (permissive free software license), you can use and modify it for commercial purposes.
3. A simple routing structure. Kohana has an excellent routing mechanism with which we can manage different kinds of URLs. For a URI, the routing mechanism will search for the first matching rout and the remaining will be ignored.
4. Kohana is OOP framework. It means that everything is built using strict PHP 5 classes and objects. It offers many benefits such as visibility protection, automatic class loading, overloading, interfaces, abstracts, and singletons.
5. Simple and effective debugging and profiling tools. Kohana has very simple and effective debugging and profiling tools that help to identify and solve performance issues very quickly.
6. No code generators and endless configuration files.There are no code generators and endless configuration files, so setting up is fast and easy.
7. Extremely lightweight. Kohana has no dependencies on PECL extensions or PEAR libraries. Large, monolithic libraries are avoided in favor of optimized solutions.
8. True auto-loading of classes. True on-demand loading of classes, as they are requested in your application. There are no namespace conflicts. All classes are suffixed to allow similar names between components, for a more coherent API.
9. Cascading resources offer unparalleled extensibility. Almost every part of Kohana can be overloaded or extended without editing core system files. Modules allow multi-file plug-ins to be added to your application.
10. Customization potential. Kohana has powerful event handler. Observer-style event handlers allow for extreme levels of customization potential.
To sum it up, Kohana is really an excellent framework because of many nice features incorporated in it. It is more scalable, flexible and light weight than many other well known frameworks. It is very fast, very efficient and carefully optimized for real world usage. So if you are looking for a feature rich, flexible, fast and sensibly configurable PHP framework, then look no further than Kohana.
Thank you for attention! As usual, please feel free to share your thoughts in comments. 🙂
It’s surprising that in our blog we have never written about Python frameworks and Python itself either. So, I’ve decided to help out the omission 🙂
When choosing a framework for site development you have many things to consider. If the criterion is a programming language, for Microsoft and C# followers the choice is clear – ASP.NET. Those who are in love with Ruby don’t have to think too much either – Ruby on Rails will be their choice. It’s much more complicated for Python, PHP and Java developers to make up their mind: the quantity of frameworks here is tremendous.
Firstly, I want to underline the pluses of Python frameworks in general:
- Usage of Python language. I’m sure lots of programmers are pretty tired of praising Python. But to write a site on Python is really faster, cheaper and more pleasantly than on other languages.
- Wide choice. Frameworks abundance can be scaring only for beginners. A professional always welcomes the freedom of choice, as the chance to find what you really need only increases. Besides, choice entails competition, and healthy competition leads to quality improvement of every framework.
- Rapid development. New frameworks emerge constantly, and their precursors either give their way to the younger ones, or continue their struggle for leadership: bugs are fixed, new features are implemented. It differentiates Python community from, Ruby community, for instance, which is represented mostly by Ruby on Rails. Due to the lack of new ideas we can see some standstill in Ruby on Rails development.
- Opensource. They say using quality software on a legal and free basis is really cool 🙂
For now there are several dozens of Python frameworks. Among them are famous Django, Pylons, Turbogear, and some other interesting ones, as Zope, Twisted, CherryPy.
Today I want to make a short review of the more popular Python framework – Django.
Django was created specially for convenient news site development of The World Company. It had been developed since 2000, but to the general public it was presented only in the middle of 2005. The framework got its name after a Belgian jazz guitarist and composer Django Reinhardt.
Django site is built from one or several applications, which are recommended to be made alienable and interconnected (unlike Ruby on Rails, for example). One of the main Django advantage is excellent documentation, and, I suppose, the biggest community among all the Python frameworks.
When getting acquainted with Django, firstly, his built-in administrator interface wins over. It provides convenient work with the content of a written site. You should change the settings a little bit, then following the link http://127.0.0.1:8000/admin you can start the page through which it is easy to manage the content (for example, to look through the data base content and change it).
Django architecture is a bit different from classic MVC. Controller of the classic model MVC approximately corresponds the level, which is called “View” in Django. Presentation View logic is realized on the level of Templates. Due to this Django level architecture is frequently called “Model-Template-View” (MTV).
For models Django provides an abstraction level which frees from the necessity of writing SQL-requests for getting/saving data to the database. All the tables, that are used in the application, are written as classes in a separate file models.py. Then with the help of these classes methods there happens manipulation of the tables content in the code. Thus, work with database becomes fully object-oriented. Django supports work with the main databases (PostgreSQL, SQLite3, MySQL, Oracle).
Also, it is worth noting about a very flexible way of urls reflection on the application function – with the help of regular expressions.
While developing an application it is convenient to use built-in server. It automatically determines the changes in the files of the project source code and reboots. The result from changes made to the code immediately displays on a browser web-page, but it is not recommended to use it as a working one, as it is single-threaded and do not provide any security measures. For these purposes you will have to set a normal server (Apache, for example).
To be honest till the very end, I will enumerate Django disadvantages as well:
- Though the template language is simple, still it is not very “pythonic”
- Not very convenient work with AJAX
- There can emerge some difficulties while replacing components (if you are in bad relations with regular expressions, which are used widely in urls reflection, you may want to use another dispatcher). It is widely believed that Django developers quite often invent bikes. Though Django allows doing this easily and quickly.
Although Django is one of the most popular Python frameworks, do not forget that framework is just an instrument; the choice should depend on the task set firstly, and only after that on its popularity.
Thank you for consideration. As usual, I would be happy to see your comments 🙂
Business Development Manager
Professional Software Development