Altabel Group's Blog

Archive for the ‘MVC’ Category

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.
 
Backgroud

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.
 

 
Peculiarities

  • 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.
 
“Pros”

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.
 
“Cons”

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.
 
Community resources

The Laravel community is growing fast and there are a lot of support and learning resources available.

Documentation for the framework can be found on the Laravel website. The documentation is very detailed and there is a large community based around Laravel. Some of the notable community resources are Laracasts, Forums, Podcasts, Jobs, Laravel News and Laracon.

Laracast
  • Laracasts. Laracasts is a paid video site, with numerous series that contain programming lessons on Laravel, PHP, Javascript and more. Jeffery Way does a fantastic job of explaining how things work and the concepts and design patterns that fuel the Laravel framework. Laracasts is a huge plus for Laravel. And having this resource available is another reason to love the framework.
  • 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.
     
    Conclusion

    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.

     

    Victoria Sazonchik

    Victoria Sazonchik

    Business Development Manager

    E-mail: victoria.sazonchik@altabel.com
    Skype: victoria_sazonchik
    LI Profile: Victoria Sazonchik

     

    altabel

    Altabel Group

    Professional Software Development

    E-mail: contact@altabel.com
    www.altabel.com

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.

The Bad:

  • 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.

The Good:

  • 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!

Ref: MICHAL DYMEL – DEVBLOG

 

Darya Bertosh

Darya Bertosh

Business Development Manager

E-mail: darya.bertosh@altabel.com
Skype: darya.bertosh
LI Profile: Darya Bertosh

 

altabel

Altabel Group

Professional Software Development

E-mail: contact@altabel.com
www.altabel.com

Let`s start from a bit of history. React.js is a JavaScript library for building UIs. It was created by Facebook development team to deal with large applications with data that changes over time: react.js hits the “refresh” button any time data changes, and knows to only update the changed parts. Firstly, react was used in-house at Facebook and then it was released as an open-source project and it has quickly gained popularity among developers.

Facebook is not the only one to use React:

Instagram is 100% built on React, both public site and internal tools ;

Yahoo`s mail client is made in React;

Netflix – the biggest paid video-streaming service;

Sberbank, bank #1 in Russia, is built with React;

Khan Academy uses React for most new JS development.

React in comparison to Angular.js isn`t a complete framework. However we can`t say that React.js is only “V” in the MVC. After a closer look, you can actually see that React.js is more than just “V”, it has quite some features of the C (controller) part as well. This is why React is so confusing to understand.

Let`s see why React.js stands out from the crowd:

Convenient architecture

Flux – is highly competitive to MVC. One-way data flow provides maintainability and efficient arrangement of data and DOM elements.

Virtual DOM

React developers suggested using “virtual DOM” in order to solve performance issue for websites with too dynamic DOM. All changes in a document are made there first, and then React looks for the shortest path to apply them in a real DOM tree. This approach makes the framework fast.

Components

React is fundamentally different than other front-end frameworks in that each asset is made up of many isolated components. Want a button changed across the whole platform? Change it once and voilà it`s changed everywhere.

By making the creation, distribution and consumption of isolated reusable components more straightforward, developers are better able to save time by using and creating common abstractions. This is true of both low level elements like buttons and high level elements such as accordions.

JSX

React.js uses a special syntax called JSX, which allows to mix HTML with Javascript. Markup and code are composed in the same file. This means code completion gives you a hand as you type references to your component’s functions and variables.

SEO  friendly

React is significantly more SEO friendly than most JavaScript MVC frameworks. As it is based on a virtual DOM you can use it on the server without needing a headless browser on the server such as Phantom.js to render pages to search engine bots.

React.js is a new interesting emerging Javascript library. It does have some drawbacks however it`s an excellent alternative for building large apps where data changes quickly. We are curious to hear about your experience in using React.jsJ Have you tried it?

 

Anna Kozik

Anna Kozik

Business Development Manager

E-mail: Anna.Kozik@altabel.com
Skype: kozik_anna
LI Profile: Anna Kozik

 

altabel

Altabel Group

Professional Software Development

E-mail: contact@altabel.com
www.altabel.com

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🙂

Kind regards,

Nadya Klim

Business Development Manager

 

altabel

Altabel Group

Professional Software Development

E-mail: contact@altabel.com
www.altabel.com

Tags: , , , ,

%d bloggers like this: