Angel \”Java\” Lopez on Blog

April 17, 2014

Dynamic Applications in Node.js

Filed under: JavaScript, MyApps, NodeJs, Open Source Projects, Video — ajlopez @ 6:55 pm

Last year I participated in the competition Node.js Knockout organized by Nodejitsu. Working alone, in the Solo Ninja team, I was coding two days in a weekend. My project, largely written using the TDD flow, aims to define one or more online applications. An application can have one or more lists of entities. Each entity can have properties defined interactively. I should add one to many relations between entities.

You can see the video presentation of my work to the judges:

http://youtube.com/watch?v==GQdyyNWCasI

After the competition, I moved my code into my GitHub account:

https://github.com/ajlopez/MyApps

I found interesting to dynamically define an application, rather than write it or generate code from a model. JavaScript and Node.js is a dynamic duo that helped me to implement this type of applications. My goal is to extend the ideas in order to have a simple implementation of what could be armed with Force, Salesforce. Some ideas:

- Add programming tasks (written in controlled JavaScript)
- More viewers (for web and mobile)
- Public and private application store
- Deploy an application written by others

In recent weeks I’ve been studying SharePoint Online. Now, I have new ideas for implement an Application Store for dynamic applications.

More fun is coming!

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 31, 2014

Smalltalk, JavaScript, NodeJs, C#, and Tutti Li Fiocci

Filed under: AjTalk, C Sharp, JavaScript, NodeJs, Smalltalk, Talks, Video — ajlopez @ 5:43 pm

Past year, I gave a talk at Smalltalks 2013, Rosario, Argentina. The conference was a great experience to me, and there were many interesting talks, implementations and ideas.

My talk was about implementing Smalltalk, in C#, and JavaScript. The main repos are:

http://github.com/ajlopez/AjTalk (I presented it at Smalltalks 2010)
https://github.com/ajlopez/AjTalkJs (I presented it at Smalltalks 2011)

My recorded talk:

http://www.youtube.com/watch?v=-KFjSneVE2s

The presentation:

https://github.com/ajlopez/Talks/tree/master/Smalltalks2013
http://ajlopez.github.io/Talks/Smalltalks2013/index.html
More talks at http://ajlopez.github.io/Talks/

The first project is an interpreted based on byte codes, written in C#. It can compile to JavaScript, but the key features is to have a VM based on bytecodes, that have access to native .NET types and objects, remote execution, actors, and more. See my posts.

The second project is an implementation of Smalltalk but in JavaScript. Internally, it have a compiler to JavaScript, but also a compiler to bytecodes and then, an interpreted VM written in JavaScript. Both projects now supports NPM (Node.js package manager) for new modules.

In 2013, I added Node.js support and access to AjTalkJs, so I can run an Express application from Smalltalk:

 

Next experiments: distributed message. That is, an object in one machine sends a message to an object in a remote machine/process,  in a fire and forget way. I think Node.js ecosystem is a good plate to host such experiments. My previous work at Distributed Applications with Node.js. I want a distributed Smalltalk machine/application. Maybe, if the communication protocol is easy or pluggable, I could add clients/servers implemented in other Smalltalk dialects. But baby steps first ;-)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

January 16, 2014

TDD Rocks! (9) JavaScript and Node.Js

Filed under: JavaScript, NodeJs, Test-Driven Development, Video — ajlopez @ 6:20 pm

Previous post

Thanks to JavaScript Meetup group at Buenos Aires, I gave an introductory talk about JavaScript and Test-Driven Development, using Node.js. The sample is basic, but I hope it is an starting point to appreciate the goodness of TDD workflow in JavaScript development.

The meetup group link:

http://www.meetup.com/Meetup-js/

My talk in “Anglish”:

http://www.youtube.com/watch?v=iAHxyN6oZjY

My presentation:

https://github.com/ajlopez/Talks/tree/master/TddJavaScript
http://ajlopez.github.io/Talks/TddJavaScript/index.html#/

Links/modules:

http://nodejs.org/
https://github.com/ajlopez/SimpleUnit
http://qunitjs.com/

Full post in Spanish http://msmvps.com/blogs/lopez/archive/2013/11/08/tdd-rocks-8-javascript-y-node-js.aspx with additional video and text in Spanish.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

December 28, 2013

TDD Rocks! (8) SharpBase in C#

Filed under: C Sharp, Google, Open Source Projects, ShapBase, Test-Driven Development, Video — ajlopez @ 6:24 pm

Previous Post
Previous Post with C#
Next Post

I recorded a new Google Hangout about using TDD (Test-Driven Development) workflow in Visual Studio 2010 and C#, writing my in-memory database project, SharpBase.

The video at:

http://www.youtube.com/watch?v=ymQePMZ2XEo

This time I implemented a Column class. It was not need in previous tests. But now, I want to have the use case of having an autonumeric column, I added tests and functionality to cover that feature. I didn’t design all at advance. I designed the solution test by test, use case by use case. Maybe, in some point, I would apply a surgical refactor/redesign, but now, I have the test battery to support such change.

This is the last video about SharpBase. Since now, I will update directly the GitHub repo. You can check:

https://github.com/ajlopez/SharpBase

https://github.com/ajlopez/SharpBase/commits/master

Maybe, I will record a new exercise, but in Spanish: an MVC application.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

December 21, 2013

TDD Rocks! (7) OStore With JavaScript/Node.Js

Filed under: Google, JavaScript, NodeJs, Test-Driven Development, Video — ajlopez @ 6:35 pm

Previous Post
Previous Post with JavaScript/Node.js
Next Post

I published a new Google Hangout session, showing how I’m working on project OStore, using TDD Workflow:

http://www.youtube.com/watch?v=PUTnaTDNCEw

]

In this sample, I’m not learning JavaScript, I already known it. I use the minimal code, in this case the module assert, built-in in Node.js. I sacrifice the isolation of test to gain in simplicity.

In this session, I implemented a find methods a la query by example, like in MongoDb. Now, it is returning an array of JavaScript objects. I could refactor it to return a cursor. Then, the cursor could retrieve millions of records, without using an array as memory.

But you know my workflow: baby steps, make it works, then, make it right, make i fast. In other project I’m reproducing MongoDB behavior directrly in in-process JavaScript.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

December 1, 2013

TDD Rocks! (6) Playing with Ruby

Filed under: Google, Open Source Projects, Ruby, Test-Driven Development, Video — ajlopez @ 3:34 pm

Previous Post
Previous Post with Ruby

I’m still learning Ruby. To practice the language, I’m writing a Tokenizer using my TDD (Test-Driven Development) workflow.

A new video at

http://www.youtube.com/watch?v=X-mTCyhm7ds

I did two redesigns:

- To provide the text to tokenize in the tokenizer constructor

- Rename getTokens methods to a more "rubyist” name get_tokens

After those redesigns, I dived into a big implementation refactor. Maybe, I had to avoid that work, or split it in more manageable pieces. At the end, I survived, and the tokenizer implementation is started to emerge. You can check another of my implementations, in JavaScript/NodeJs:

https://github.com/ajlopez/KodeTokenizer

The Ruby version is at:

https://github.com/ajlopez/TddRocks/commits/master/Ruby

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

November 30, 2013

TDD Rocks! (5) SharpBase in C#

Filed under: C Sharp, Google, Open Source Projects, ShapBase, Test-Driven Development, Video — ajlopez @ 2:01 pm

Previous Post
Next Post
Next Post with C#

I’m coding SharpBase, documenting my TDD workflow using Google Hangouts. The new video at:

http://www.youtube.com/watch?v=b0-PIWqsrn0

I implemented how to insert a row, given its values the method returns the new row. In this first test I only tested that the row was built. In the second tests I managed to implement the store of rows in a table. There is no interaction between rows and columns, yet. I could add tests for:

- Insert has less values than defined columns

- Insert has more values than defined columns

- Defined types in columns

- Autonumeric column

- Primary Key column

- Retrieve by primary key value

- Retrieve with given values (like MongoDB find), that is, query by example

- Query with operators

Those are things to write in the upcoming tests. I could record one or more videos, and then, I would switch to direct code in GitHub. The videos are for explaining the workflow, but after a few example I guess the process is clear. The idea is to implement using “baby steps”, and new tests/examples. TDD is like to play a videogame. Each new test/example is a challenge, and when we code to pass the test in green, we reach a new level in the game.

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

November 29, 2013

TDD Rocks! (4) SharpBase In C#

Filed under: C Sharp, Google, Open Source Projects, Test-Driven Development, Video — ajlopez @ 2:09 pm

Previous Post
Next Post

This is the second part in my series of using TDD in the writing of SharpBase, simple in-memory database, in C#. The new video:

http://www.youtube.com/watch?v=JzETZYeBgO8&feature=youtu.be

As in the previous video, I’m adding tests, advancing by “baby steps”. The code is at:

https://github.com/ajlopez/SharpBase

I added tests over tables, testing how to add columns using their names. The columns still have no type or other features. In the next installment, I will add the insertion of a row to a table.

I hope you can understand my spoken Anglish ;-)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

November 27, 2013

TDD Rocks! (3) SharpBase in C#

Filed under: C Sharp, Google, Open Source Projects, Test-Driven Development, Video — ajlopez @ 4:46 pm

Previous Post
Next Post

You already know, I like to code models in memory. Some time ago (months? years?) I started a project to build an in-memory relational database, using C#. To practice TDD, I decided to start it again, from scratch, documenting the first steps of the process in videos. After showing my workflow, the work will continue with commits in my GitHub Account. The first video:

http://www.youtube.com/watch?v=N7zCTVZiWfo&feature=youtu.be

The code is at:

https://github.com/ajlopez/SharpBase

Notice I didn’t make “big decisions” before the coding. I still don’t implement what is a Row, no idea yet for index and other stuff, like column types. I only coded the first use cases, with a simple API: create a database with name, check if it exists, etc…

I used the test library that comes with Visual Studio (Professional, Ultimate), already integrated in the IDE. Maybe, I could use NUnit or other solutions, but I’m proficient with this approach.

The important thing is not the tool: it is the workflow. Write a test with a new example, compile it, then code it to get green result, refactor, write a new example/test again, and so on. Don’t be afraid of refactoring (internal changes in implementation) or redesign (change in exposed API). And there are also test code refactoring. In general, in the refactoring we can add the patterns we know, cut repeated code, etc. In my case, I push for not have a lot of upfront design. That is the way I use in my personal and professional projects.

I hope you can understand spoken Anglish ;-) (Angel’s English)

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
@ajlopez

November 12, 2013

End Of Iteration 2013w45

Previous Post
Next Post

I’m exhausted, after my Node.js Knockout participation, last week end.

Node Knockout

It is my main deliverable for past week. I wrote a web application, in two days, from scratch, using Node.js and Express. Video with demo:

http://www.youtube.com/watch?v=GQdyyNWCasI

It’s running online at:

http://soloninja.2013.nodeknockout.com/

Now, the repo is private, but I will clone it to my public GitHub account. You can see the votes at:

http://nodeknockout.com/teams/soloninja

TDD and JavaScript

I gave a talk at local JavaScript meetup

Code at:

https://github.com/ajlopez/TddRocks/tree/master/JavaScript

Slides at:

https://github.com/ajlopez/Talks/tree/master/TddJavaScript

Other works

Minor updates at https://github.com/ajlopez/RubySharp

Updated require algorithm at https://github.com/ajlopez/AjTalkJs

Keep tuned!

Angel “Java” Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

Older Posts »

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 65 other followers