programming – Jacob N Calvert https://jacobncalvert.com/blog-archive Tue, 17 Apr 2018 03:10:20 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.17 https://jacobncalvert.com/blog-archive/wp-content/uploads/2018/02/cropped-icon-32x32.png programming – Jacob N Calvert https://jacobncalvert.com/blog-archive 32 32 Enterprise Service Buses and Middleware https://jacobncalvert.com/blog-archive/2018/03/14/enterprise-service-buses-and-middleware/ https://jacobncalvert.com/blog-archive/2018/03/14/enterprise-service-buses-and-middleware/#respond Wed, 14 Mar 2018 16:33:48 +0000 http://jacobncalvert.com/?p=214 Distributed computing is the new norm.   Multi-service architectures surround us daily. Our computing needs are served from many different independently operated services, and all implemented using different underlying technologies. When these independent units bring only one small service or set of services, it is called a microservice. While there is still some industry discussion about the exact properties of a microservice, one thing can be agreed upon: microservice-based systems enforce modular design by default. This begs the question, if…

The post Enterprise Service Buses and Middleware appeared first on Jacob N Calvert.

]]>
Distributed computing is the new norm.

 

Multi-service architectures surround us daily. Our computing needs are served from many different independently operated services, and all implemented using different underlying technologies. When these independent units bring only one small service or set of services, it is called a microservice. While there is still some industry discussion about the exact properties of a microservice, one thing can be agreed upon: microservice-based systems enforce modular design by default. This begs the question, if my services are decoupled and modular, how do they communicate effectively to create an entire system that performs something useful?

Enterprise Service Buses and Middleware

The solution to this problem is a connector software which acts as a message routing bus. The Enterprise Service Bus (ESB), often simplified as Middleware (although Middleware is not always an ESB), allows these decoupled services to talk to each other in a language and medium-neutral way. For instance, if you have a Service-Oriented Architecture (SOA) comprised of services written in different languages, with a few plug ‘n play components, but they all need to share data, a language-neutral ESB is in order.

Many of the commercial ESBs are written as a publisher-subscriber (PubSub) system. This allows the individual services to subscribe to the types of messages it is interested in knowing about. The ESB or Middleware is responsible for managing the “channels” and relaying the published messages to the right subscribers. The Middleware or ESB provider will usually provide a connector for many languages making it easy to interface your services to the ESB. If the connector is not provided, the specification will usually be provided so that you can implement your own connector. This allows an SOA system to communicate without worrying about the transport mechanism of its messages.

 

It’s easy to see that ESBs can be found nearly everywhere in technology. In fact, many of the most common services we use today can be loosely classified as an ESB. Perhaps I’ll start a project soon to build an ESB and see how it goes?

Thanks for reading!

 

 

The post Enterprise Service Buses and Middleware appeared first on Jacob N Calvert.

]]>
https://jacobncalvert.com/blog-archive/2018/03/14/enterprise-service-buses-and-middleware/feed/ 0
SpeedCrunch: the better cross-platform calculator https://jacobncalvert.com/blog-archive/2018/02/14/speedcrunch-the-better-cross-platform-calculator/ https://jacobncalvert.com/blog-archive/2018/02/14/speedcrunch-the-better-cross-platform-calculator/#respond Thu, 15 Feb 2018 03:44:29 +0000 http://jacobncalvert.com/?p=201 I often find myself using a calculator in my day job to convert large numbers between base-10 and hexadecimal. Windows’ built-in calculator can do it, but painfully. Linux Mint’s calculator is better, but only marginally so. Enter SpeedCrunch. SpeedCrunch is so incredibly feature-packed, and has such an intuitive interface, that I could hardly believe that it’s a free tool! Working with numbers Using the built-in functions hex and bin, numbers are easily converted into various representations. Very useful for programmers.…

The post SpeedCrunch: the better cross-platform calculator appeared first on Jacob N Calvert.

]]>
I often find myself using a calculator in my day job to convert large numbers between base-10 and hexadecimal. Windows’ built-in calculator can do it, but painfully. Linux Mint’s calculator is better, but only marginally so. Enter SpeedCrunch.

SpeedCrunch is so incredibly feature-packed, and has such an intuitive interface, that I could hardly believe that it’s a free tool!

Working with numbers

Using the built-in functions hex and bin, numbers are easily converted into various representations. Very useful for programmers.

But, its usefulness doesn’t stop there. SpeedCrunch has a very robust conversion interface and syntax. Check out this example for converting bandwidths.

SpeedCrunch - bandwidth conversions

SpeedCrunch – bandwidth conversions

SpeedCrunch also has built-in functions for almost anything you can imagine. From basic trig functions to distributions and beyond, SpeedCrunch likely has it.

What to do if you don’t find the function you need? SpeedCrunch also handles variables and user-defined functions. Simply define your function, then use it like any other built-in. Go check out SpeedCrunch, it has replaced my standard calculator, and I bet it will replace yours too.

The post SpeedCrunch: the better cross-platform calculator appeared first on Jacob N Calvert.

]]>
https://jacobncalvert.com/blog-archive/2018/02/14/speedcrunch-the-better-cross-platform-calculator/feed/ 0
Introducing WebPHP, a(nother) PHP framework https://jacobncalvert.com/blog-archive/2014/12/17/introducing-webphp-another-php-framework/ https://jacobncalvert.com/blog-archive/2014/12/17/introducing-webphp-another-php-framework/#respond Thu, 18 Dec 2014 04:26:36 +0000 http://jacobncalvert.com/?p=142 I’ve been working on a new project lately and I’m calling it WebPHP. I wanted something that operated somewhat like Tornado for Python.. but in PHP. I essentially wanted some framework that could simply be dropped onto the root of a hosted server from GoDaddy or the like, and a developer could immediately map URLs using a regex-like syntax to handler classes. I found some other frameworks to do this, but a lot of them seemed tightly coupled to a…

The post Introducing WebPHP, a(nother) PHP framework appeared first on Jacob N Calvert.

]]>
I’ve been working on a new project lately and I’m calling it WebPHP. I wanted something that operated somewhat like Tornado for Python.. but in PHP.

I essentially wanted some framework that could simply be dropped onto the root of a hosted server from GoDaddy or the like, and a developer could immediately map URLs using a regex-like syntax to handler classes. I found some other frameworks to do this, but a lot of them seemed tightly coupled to a front-end framework not to mention complicated to install or maintain. Hence my creation of WebPHP. WebPHP works by mapping a URL with regex style syntax like

	/api/users/(.+)/?			Maps to http://example.com/api/users/{anything}

	/api/users/jacobcalvert/profile/?	Would get my profile in this example service

to some handler class that would do something with the request. The way this map is defined is shown below:

	new webphp\UrlMap("/(.+)/?", array("the_variable"),'ExampleHandler', array())

WebPHP would populate a variable called “the_variable” and instantiate an object of type ExampleHandler. ExampleHandler must be a derived class of the base WebRequest class defined by WebPHP. ExampleHandler could look like:

class ExampleHandler extends webphp\WebRequest
{
    /*
     * example handler for webphp
     */
    public function get()
    {
        $this->add_header("Content-Type", "application/json");
        $this->write(json_encode($this->params, JSON_UNESCAPED_SLASHES)); 
    }
    
    public function post()
    {
        $this->add_header("Content-Type", "application/json");
        $this->set_response_code(201); // 201 is the "CREATED" response -- could be used for REST impl's
        $this->write(json_encode($this->params, JSON_UNESCAPED_SLASHES)); 
    }
    
    public function put()
    {
        $this->add_header("Content-Type", "application/json");
        $this->write(json_encode($this->params, JSON_UNESCAPED_SLASHES)); 
    }
    
    public function delete()
    {
        $this->set_response_code(403);
        $this->write(NULL);        
    }
    
    public function head()
    {
        // just an example of adding a custom header
        // the HEAD verb expects just the headers back about 
        // the requested document
        // or in other words, HEAD wants a GET response without the body
        $this->add_header("Custom-Header", "custom-value");
        $this->write(NULL);
    }
}

The WebPHP app would call the appropriate handler method depending on what HTTP verb was used in the request. If no method is defined for a verb that is used, the default return is a 501/Not Implemented response. One of the interesting features I was able to add is the ability to enforce SSL connections on specific URL maps or on entire handlers. Hop over to theĀ GitHub pageĀ for more information and to see all the classes and example.

The post Introducing WebPHP, a(nother) PHP framework appeared first on Jacob N Calvert.

]]>
https://jacobncalvert.com/blog-archive/2014/12/17/introducing-webphp-another-php-framework/feed/ 0