Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop

    What is Frameworks in Programming?

    Blogs
    development programming frameworks web development
    6
    10
    2047
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • b6
      b6 last edited by

      Frameworks


      Most guys specially ๐Ÿ˜Ž beginners asked me What is framework?
      They said, that they read so many articles but still they are confused ๐Ÿ˜ต .

      frameworks

      Let's Imagine,

      You need to drive a car, So First you should start the car, Then put the correct gear, then you need to change the gear in correct order.

      But, If you take auto-gear car, You just wanna start and press accelerator only,
      The gear will be changed automatically.

      So they build a environment for this specific scenario. It will handle the gear, No trouble for us.

      Like that,

      If you wanna build a software, That is a huge process (Except Development),

      When you come to code a software, You need to

      1. Design Views.
      2. Setup environment.
      3. Install Dependencies.
      4. Define Modals.
      5. Write Logic.
      6. Bind Modals with Databases.

      And other Blah Blah things.

      The Frameworks are helping us to done these jobs easily, quickly and perfectly.

      โ‰ โ‰ Why Frameworks?


      As I mentioned, Frameworks are making our tasks easy. So we can save a lot of development time.

      And also, If you follow your own structure It will be little hard to follow to your co-developers. Because everyone have their own style. But If you use a framework, That will have a standard pattern,

      So the whole development should follow the same standard, And any developer who knows that framework standard can understand the code.

      So, It will increase the code maintainability

      ๐Ÿง How?


      Structures

      Framework has a well defined environment and structure, We need to just follow their manual and put correct files in correct places, That's all, It will bind it automatically.

      PHP - Laravel Framwork Folder Sructure

      Laravel Folder Structure

      Routers

      All the Web Frameworks have Routers, Which will Route a request to a handler / controller.

      In web applications, If we want to add routing based URL we need to configure a lot of things.

      For Example : -

      In Apache and PHP, We need to configure .htaccess file to redirect requests to a specific PHP file, And then we need write logic in PHP file to handle the incoming requests.

      But in frameworks, They will have a specific file for Routing. You just need to add, Which URL -> where to go. Thats it.

      Laravel Framework Router

      Laravel Router

      Built-In functions

      Most of the frameworks have some awesome built-in functions to make our work much easier.

      Example (PHP)

      //Traditional Way to set and get a Session.
      session_start();
      $_SESSION['username'] = 'John';
      $username = $_SESSION['username'];
      
      //Using Laravel Framework.
      session('username','John');
      $username = session('username');
      

      //Validation in Traditional way
      public function login()
      {
          $username = (isset($_POST['username'])) ? $_POST['username'] : null;
          $password = (isset($_POST['password'])) ? $_POST['password'] : null;
      
          if(!empty($username) && !empty($password) && (strlen($username) <= 10)) {
             //valid
          }   
      
      }
      
      //Validation in Laravel Framework
      public function login(Request $request)
      {
          $validatedData = $request->validate([
              'username' => 'required|max:10',
              'password' => 'required',
          ]);
      }
      

      How simple, Frameworks have a lot of awesome functions โค!


      Conclusion

      Frameworks are well planned and structured setup for build a software.
      It handles more than 50% of development procedures and saves our time.

      1 Reply Last reply Reply Quote 2
      • dev_lak
        dev_lak last edited by

        nice explanation bro... :hearts:

        b6 1 Reply Last reply Reply Quote 1
        • b6
          b6 @dev_lak last edited by

          @dev_lak ๐Ÿ‘๐Ÿ‘๐Ÿ‘

          1 Reply Last reply Reply Quote 1
          • Nubelle
            Nubelle Web Development last edited by

            wow b6 brooo , wonderful

            b6 1 Reply Last reply Reply Quote 1
            • b6
              b6 @Nubelle last edited by

              @Malith thx bro

              1 Reply Last reply Reply Quote 0
              • T
                thilina last edited by

                Thnks bro..

                b6 1 Reply Last reply Reply Quote 1
                • b6
                  b6 @thilina last edited by

                  @thilina ๐Ÿ‘๐Ÿ‘๐Ÿ‘

                  1 Reply Last reply Reply Quote 0
                  • root
                    root Linux Help last edited by root

                    wow b6, your an amazing article writer i ever seen.

                    b6 1 Reply Last reply Reply Quote 1
                    • b6
                      b6 @root last edited by

                      @root but didn't upvote yet ๐Ÿ˜œ๐Ÿ˜œ๐Ÿ˜œ

                      1 Reply Last reply Reply Quote 0
                      • imadusanka
                        imadusanka last edited by

                        Thank u bro

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post

                        0
                        Online

                        3.7k
                        Users

                        1.3k
                        Topics

                        5.3k
                        Posts

                        • Privacy
                        • Terms & Conditions
                        • Donate

                        © Copyrights and All right reserved Lanka Developers Community

                        Powered by Axis Technologies (PVT) Ltd

                        Made with in Sri Lanka

                        | |