Corinna: Bring Modern OO to The Core Of Perl

Corinna

RFC

This file is automatically generated. If you wish to submit a PR, do not edit this file directly. Please edit templates/README.md instead.


This is to track the RFC for the Corinna MVP OOP proposal.

Important: All of the above represent works in progress. Please do not consider this the final RFC. We're writing down the shell of the RFC and will fine-tune. Anything in the Wiki should be considered "rough drafts."

Section Numbers

As you navigate the various RFC pages, you'll note that it's broken down into fine-grained section numbers such as 3.2.2. Prior to the RFC being filed, these are fluid and will likely change without warning. After the RFC is filed, we may make minor changes to the sections, but the section numbers themselves should be frozen to make it easy to refer to a given section.

Not a Tutorial

This is not a tutorial on OO programming. That could easily fill a book. It's assumed you're already very familiar with Perl's built-in OO. It's very useful if you're also familiar with Moo/se.

Principle of Parsimony

Many things in the proposal are deliberately restrictive, such as Corinna only allowing single inheritance. This is to allow Corinna to be cautious in not promising too much. If we later find this too restrictive, we can allow multiple inheritance. However, if we start with multiple inheritance and discover we don't need or want multiple inheritance, we would break existing code by taking it away.

Any proposals to change the RFC must consider the principle of parsimony.

KIM

We are trying to adhere to the KIM principle. In short, features should try to follow this syntax:

KEYWORD IDENTIFIER MODIFIER? SETUP?

So instead of this:

class Foo isa Bar does SomeRole v1.2.3 {
    overrides method some_method() {
        ...
    }
}

We're doing this:

class Foo :isa(Bar) :does(SomeRole) :version(v1.2.3) {
    method some_method :override () {
        ...
    }
}

By trying to have all syntax arranged like this we reduce the core of Corinna down to four new keywords:

  • class
  • role
  • field
  • method

Everything which tweaks those behaviors should be a modifier.

This part is still a work in progress and may evolve.

This Repository

This repository is not for code. Instead, it’s to have a central place to discuss the Corinna proposal to bring modern OO to the core of the Perl language.

You may be looking for the Wiki as that has much historical discussion of this project. However, the documents in the rfc/ folder will be considered the canonical ones.

You can file issues to address your particular concerns and get feedback.

MVP

This work is to drive us to v0.1.0—not v1.0.0—the “minimum viable product.” The intent is to get the subset of features we really need into the language, make sure it’s stable, and then iterate on top of that. I don’t want us building on top of this foundation only to discover the foundation is not stable.

I’ve been getting some pushback from people being quite insistent that if I don‘t support one or more of the features that they like to use, that it will be so terribly hobbled that it will be of limited use to them.

Please keep in mind that if this MVP does get into core, I will have lost control over it (yay!) and I’ll have no particularly greater voice than others. That means:

If this gets into the core and you want a feature, lobby for it.

I’m not a gatekeeper. I don’t want to be a gatekeeper. I want to get modern OO into the Perl core and the more things added to the MVP to scratch people’s personal itches, the more bugs there will be and the less likely it is to be stable. Let’s focus on the MVP and getting this in core.

After that, it will be up to the community to decide where it wants to go. I will have zero authority to stop things I disagree with if P5P decides to implement them. This will effectively be a democracy. A level playing field. If you won’t support Corinna because your personal favorite feature isn’t in the MVP, I don’t know what to say to that. You, like everyone else, will be able to lobby for that feature.

DEDICATION

This project is dedicated to the memory of both Jeff Goff and David Adler, two Perl developers who also loved Raku and worked to create a better language. They were both wonderful people and will be missed.


Download Details:

Author: Ovid
Source Code: https://github.com/Ovid/Cor

License: Artistic-2.0 license

#perl 

What is GEEK

Buddha Community

Corinna: Bring Modern OO to The Core Of Perl
Einar  Hintz

Einar Hintz

1602560783

jQuery Ajax CRUD in ASP.NET Core MVC with Modal Popup

In this article, we’ll discuss how to use jQuery Ajax for ASP.NET Core MVC CRUD Operations using Bootstrap Modal. With jQuery Ajax, we can make HTTP request to controller action methods without reloading the entire page, like a single page application.

To demonstrate CRUD operations – insert, update, delete and retrieve, the project will be dealing with details of a normal bank transaction. GitHub repository for this demo project : https://bit.ly/33KTJAu.

Sub-topics discussed :

  • Form design for insert and update operation.
  • Display forms in modal popup dialog.
  • Form post using jQuery Ajax.
  • Implement MVC CRUD operations with jQuery Ajax.
  • Loading spinner in .NET Core MVC.
  • Prevent direct access to MVC action method.

Create ASP.NET Core MVC Project

In Visual Studio 2019, Go to File > New > Project (Ctrl + Shift + N).

From new project window, Select Asp.Net Core Web Application_._

Image showing how to create ASP.NET Core Web API project in Visual Studio.

Once you provide the project name and location. Select Web Application(Model-View-Controller) and uncheck HTTPS Configuration. Above steps will create a brand new ASP.NET Core MVC project.

Showing project template selection for .NET Core MVC.

Setup a Database

Let’s create a database for this application using Entity Framework Core. For that we’ve to install corresponding NuGet Packages. Right click on project from solution explorer, select Manage NuGet Packages_,_ From browse tab, install following 3 packages.

Showing list of NuGet Packages for Entity Framework Core

Now let’s define DB model class file – /Models/TransactionModel.cs.

public class TransactionModel
{
    [Key]
    public int TransactionId { get; set; }

    [Column(TypeName ="nvarchar(12)")]
    [DisplayName("Account Number")]
    [Required(ErrorMessage ="This Field is required.")]
    [MaxLength(12,ErrorMessage ="Maximum 12 characters only")]
    public string AccountNumber { get; set; }

    [Column(TypeName ="nvarchar(100)")]
    [DisplayName("Beneficiary Name")]
    [Required(ErrorMessage = "This Field is required.")]
    public string BeneficiaryName { get; set; }

    [Column(TypeName ="nvarchar(100)")]
    [DisplayName("Bank Name")]
    [Required(ErrorMessage = "This Field is required.")]
    public string BankName { get; set; }

    [Column(TypeName ="nvarchar(11)")]
    [DisplayName("SWIFT Code")]
    [Required(ErrorMessage = "This Field is required.")]
    [MaxLength(11)]
    public string SWIFTCode { get; set; }

    [DisplayName("Amount")]
    [Required(ErrorMessage = "This Field is required.")]
    public int Amount { get; set; }

    [DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}")]
    public DateTime Date { get; set; }
}

C#Copy

Here we’ve defined model properties for the transaction with proper validation. Now let’s define  DbContextclass for EF Core.

#asp.net core article #asp.net core #add loading spinner in asp.net core #asp.net core crud without reloading #asp.net core jquery ajax form #asp.net core modal dialog #asp.net core mvc crud using jquery ajax #asp.net core mvc with jquery and ajax #asp.net core popup window #bootstrap modal popup in asp.net core mvc. bootstrap modal popup in asp.net core #delete and viewall in asp.net core #jquery ajax - insert #jquery ajax form post #modal popup dialog in asp.net core #no direct access action method #update #validation in modal popup

Corinna: Bring Modern OO to The Core Of Perl

Corinna

RFC

This file is automatically generated. If you wish to submit a PR, do not edit this file directly. Please edit templates/README.md instead.


This is to track the RFC for the Corinna MVP OOP proposal.

Important: All of the above represent works in progress. Please do not consider this the final RFC. We're writing down the shell of the RFC and will fine-tune. Anything in the Wiki should be considered "rough drafts."

Section Numbers

As you navigate the various RFC pages, you'll note that it's broken down into fine-grained section numbers such as 3.2.2. Prior to the RFC being filed, these are fluid and will likely change without warning. After the RFC is filed, we may make minor changes to the sections, but the section numbers themselves should be frozen to make it easy to refer to a given section.

Not a Tutorial

This is not a tutorial on OO programming. That could easily fill a book. It's assumed you're already very familiar with Perl's built-in OO. It's very useful if you're also familiar with Moo/se.

Principle of Parsimony

Many things in the proposal are deliberately restrictive, such as Corinna only allowing single inheritance. This is to allow Corinna to be cautious in not promising too much. If we later find this too restrictive, we can allow multiple inheritance. However, if we start with multiple inheritance and discover we don't need or want multiple inheritance, we would break existing code by taking it away.

Any proposals to change the RFC must consider the principle of parsimony.

KIM

We are trying to adhere to the KIM principle. In short, features should try to follow this syntax:

KEYWORD IDENTIFIER MODIFIER? SETUP?

So instead of this:

class Foo isa Bar does SomeRole v1.2.3 {
    overrides method some_method() {
        ...
    }
}

We're doing this:

class Foo :isa(Bar) :does(SomeRole) :version(v1.2.3) {
    method some_method :override () {
        ...
    }
}

By trying to have all syntax arranged like this we reduce the core of Corinna down to four new keywords:

  • class
  • role
  • field
  • method

Everything which tweaks those behaviors should be a modifier.

This part is still a work in progress and may evolve.

This Repository

This repository is not for code. Instead, it’s to have a central place to discuss the Corinna proposal to bring modern OO to the core of the Perl language.

You may be looking for the Wiki as that has much historical discussion of this project. However, the documents in the rfc/ folder will be considered the canonical ones.

You can file issues to address your particular concerns and get feedback.

MVP

This work is to drive us to v0.1.0—not v1.0.0—the “minimum viable product.” The intent is to get the subset of features we really need into the language, make sure it’s stable, and then iterate on top of that. I don’t want us building on top of this foundation only to discover the foundation is not stable.

I’ve been getting some pushback from people being quite insistent that if I don‘t support one or more of the features that they like to use, that it will be so terribly hobbled that it will be of limited use to them.

Please keep in mind that if this MVP does get into core, I will have lost control over it (yay!) and I’ll have no particularly greater voice than others. That means:

If this gets into the core and you want a feature, lobby for it.

I’m not a gatekeeper. I don’t want to be a gatekeeper. I want to get modern OO into the Perl core and the more things added to the MVP to scratch people’s personal itches, the more bugs there will be and the less likely it is to be stable. Let’s focus on the MVP and getting this in core.

After that, it will be up to the community to decide where it wants to go. I will have zero authority to stop things I disagree with if P5P decides to implement them. This will effectively be a democracy. A level playing field. If you won’t support Corinna because your personal favorite feature isn’t in the MVP, I don’t know what to say to that. You, like everyone else, will be able to lobby for that feature.

DEDICATION

This project is dedicated to the memory of both Jeff Goff and David Adler, two Perl developers who also loved Raku and worked to create a better language. They were both wonderful people and will be missed.


Download Details:

Author: Ovid
Source Code: https://github.com/Ovid/Cor

License: Artistic-2.0 license

#perl 

Einar  Hintz

Einar Hintz

1602564619

MVC User Registration & Login with ASP.NET Core Identity

User registration and authentication are mandatory in any application when you have little concern about privacy. Hence all most all application development starts with an authentication module. In this article, we will discuss the quickest way to use **ASP.NET Core Identity for User Login and Registration **in a new or existing MVC application.

Sub-topics discussed :

  • How to add ASP.NET Core Identity to MVC application.
  • Customize ASP.NET Core Identity.
  • Identity.UI Design Customization.
  • Next step.

Background

ASP.NET Core Identity is an API, which provides both user interface(UI) and functions for user authentication, registration, authorization, etc. Modules/ APIs like this will really be helpful and fasten the development process. It comes with ASP.NET Core Framework and used in many applications before. Which makes the API more dependable and trustworthy.

ASP.NET Core MVC with user authentication can easily be accomplished using Identity.UI. While creating the MVC project, you just need to select Authentication as Individual User Accounts.

Showing how to create an MVC application with ASP.NET Core Identity API

The rest will be handled by ASP.NET Core Identity UI. It already contains razor view pages and backend codes for an authentication system. But that’s not what we want in most of the cases. we want to customize ASP.NET Core Identity as per our requirement. That’s what we do here.

Create an ASP.NET Core MVC Project

First of all, I will create a brand new ASP.NET Core MVC application without any authentication selected. We could add ASP.NET Core Identity later into the project.

In Visual Studio 2019, Go to File > New > Project (Ctrl + Shift + N). From new project window, select ASP.NET Core Web Application.

Create an ASP.NET Core Web application

Once you provide the project name and location. A new window will be opened as follows, Select _Web Application(Model-View-Controller), _uncheck _HTTPS Configuration _and DO NOT select any authentication method. Above steps will create a brand new ASP.NET Core MVC project.

Select Model View Controller templet under .NET Core

#asp.net core article #asp.net core #add asp.net core identity to existing project #asp.net core identity in mvc #asp.net core mvc login and registration #login and logout in asp.net core

Authorization in asp.net core

#Asp.net core #Asp.net core mvc #Core #Asp.net core tutorials #Asp.net core with entity framework

AllowAnonymous in asp.net core

#Asp.net core #Asp.net core mvc #Core #Asp.net core tutorials #Asp.net core with entity framework