You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this HTML example you can see some unusual properties inside the tags often prefixed with `ng-`.
76
74
These are standard Angular _directives_ that add behaviour or functionality to those tags.
77
75
This is done by the Angular library by scanning the HTML client-side. The `todo-list` attribute in the top `<div>` refers to the controller written in Dart below, which manages the logic of adding todos:
In the next section the Angular framework is described: Its stakeholders are analyzed, as well as the project's organization. Then, the implementation and its functions are assessed, after which the evolution is described and the metrics for evaluation are introduced. Lastly, the contributions made are discussed.
119
115
@@ -153,31 +149,33 @@ Now that we looked into the people involved in Angular, its architecture is expl
153
149
Modules are functional, largely independent, units in the project that contain multiple files of source code. It is an 'encapsulation' of a specific aspect of the project. The two main advantages of the modular programming method are (1) simplification of code through limitation of dependencies between modules and (2) easier organisation of distributed programming because teams (or individuals) can specialize on single modules instead of having to know all the source code [Sun Microsystems, 2007](https://netbeans.org/project_downloads/usersguide/rcp-book-ch2.pdf).
154
150
155
151
Although the AngularDart repository could be considered to be relatively small, it also benefits from modules to structure the source code. The code section below illustrates a folder structure in the AngularDart project. It depicts the /lib folder, which actually contains 15 folders and 10 files.
156
-
<pre><code>
157
-
angular.dart/lib
158
-
/animate # contains files that provide animation functionality for angular.dart
159
-
animation_loop.dart
160
-
animation_optimizer.dart
161
-
animations.dart
162
-
css_animate.dart
163
-
module.dart
164
-
[...]
165
-
/core # folder with core elements of angular.dart
166
-
/parser # sub-folder of /core containing parsing functions
167
-
[...]
168
-
module.dart
169
-
annotation.dart # source code file that adds annotation
170
-
exception handler.dart # source code file that handles exceptions in angular.dart
171
-
[...]
172
-
</code></pre>
152
+
153
+
angular.dart/lib
154
+
/animate # contains files that provide animation functionality for angular.dart
155
+
animation_loop.dart
156
+
animation_optimizer.dart
157
+
animations.dart
158
+
css_animate.dart
159
+
module.dart
160
+
[...]
161
+
/core # folder with core elements of angular.dart
162
+
/parser # sub-folder of /core containing parsing functions
163
+
[...]
164
+
module.dart
165
+
annotation.dart # source code file that adds annotation
166
+
exception handler.dart # source code file that handles exceptions in angular.dart
167
+
[...]
168
+
173
169
The modules in AngularDart can be identified through the 'module.dart' file in a directory. In the example above, 'animate' is a module where 'core' contains the parser.
174
170
175
171
[Christopher Hiller](https://github.com/boneskull), a Software Architect and contributor to AngularJs, explained how developers can modularize their projects when using Angular.
176
172
His blog is a good addition on the explanation above and focuses on creating modules in an organically grown coding project ([Hiller, 2014](https://blog.safaribooksonline.com/2014/03/27/13-step-guide-angularjs-modularization/)).
177
173
178
174
The overall tendency is that the main modules in `/lib` are loosely decoupled, with only the Core module binding all the modules together.
179
175
In the image below, the different modules and the dependencies between them are illustrated by a network analysis graph: Larger modules have more imcoming dependencies whilst small modules rely on such dependencies.
| Teach the browser new HTML syntax | HTML Compiler |
202
200
| Binding data in the view and in the model | Two-way data binding |
@@ -218,24 +216,23 @@ Also the differences between AngularJs and AngularDart are taken into account, r
218
216
* AngularDart is built on top of Shadow DOM, so when implementing a Component the Shadow DOM is used.
219
217
220
218
An example of the DI system differing between both versions, can be made clear as follows by an example from the blog [[2](http://victorsavkin.com/post/86909839576/angulardart-1-0-for-angularjs-developers)] of Victor Savkn:
221
-
<pre><code>
222
-
//JS:
223
-
// The name here matters, and since it will be minified in production,
// Only the type here matters, the variable name does not affect DI.
233
+
UsersRepository(Http h){/*...*/}
234
+
all(){/* ... */}
235
+
}
239
236
240
237
241
238
#### Interfaces
@@ -257,7 +254,8 @@ Connectors are the pieces of code of the architecture that link the elements, or
257
254
#### External entities
258
255
AngularDart has "other systems, software programs, hardware devices or other entities with which the system interacts" (Rozanski and Woods, p. 272), or external entities. These can be extracted from the Context view image below.
259
256
260
-

257
+

258
+
_Context view with logos_
261
259
262
260
* HTML: AngularDart extends the HTML with several directives, as discussed earlier, such as "ng-class". By using this directive, AngularDart attaches to that DOM element a specified behavior, or it can transform that DOM element (and its children).
263
261
* DOM: AngularDart relies on the DOM, which all browsers have implemented. Furthermore, it can make use of the Shadow DOM, which is a polyfiller if it is not already natively supported by the browser.
@@ -281,10 +279,13 @@ Version 2 will also add support for Web Components, which are a collection of fo
281
279
282
280
Angular 2.0 will be built using TypeScript from Microsoft. However, because no browser supports TypeScript natively yet, it will be transpiled (a source-to-source compiler, that *trans*lates code to another programming language) to EcmaScript 5. TypeScript differs from EcmaScript 5 by the addition of types to the language (type annotations, compile-time type checking and type inference). This also counts for classes, interfaces, modules and more. TypeScript is a superset of EcmaScript 5, which means that any current JavaScript program is a valid TypeScript program. However, Angular 2.0 does not offer any backwards compatibility to version 1.
In the image above you can see the way the Angular 2 is built. Since the development started on version 2 of Angular, both teams of the JavaScript and Dart version are combined into one team. Version 2 uses the facada pattern, which uses abstracted functions to improve readability of the library and the make a coherent API that is easy to use. Also, the most important reason that these facades are necessary is for the differences between JavaScript and Dart APIs. The transpiler uses these facades to compile the correct API for both languages. Traceur is the component responsible for tranpsiling the code to EcmaScript 5 and Dart.
286
286
287
-

287
+

288
+
_The team of Angular 2_
288
289
289
290
This compiler actually adds an extra option to develop Angular apps. Besides EcmaScript 5, EcmaScript 6, TypeScript and Dart, it is also possible to write Angular apps using the Traceur compiler in EcmaScript 6 and having it transpile to any number of the just mentioned languages.
290
291
@@ -347,18 +348,16 @@ The level of achievement of the goal can be measured by comparing the deltas of
347
348
For example: the number of issues being raised in AngularJs might be higher than in AngularDart or Angular 2.0, but that cannot directly concluded that AngularJs is more fragile, AngularJs has more users and contributors.
348
349
So the improvement of 2.0 over 1.0 in this measure `M` should measured as:
349
350
350
-
<pre><code>
351
-
Mjs = Issues(Ajs) / Contributors(Ajs)
352
-
Mdart = Issues(Adart) / Contributors(Adart)
353
-
M2 = Issues(A2) / Contributors(A2)
354
-
</code></pre>
351
+
Mjs = Issues(Ajs) / Contributors(Ajs)
352
+
Mdart = Issues(Adart) / Contributors(Adart)
353
+
M2 = Issues(A2) / Contributors(A2)
355
354
356
355
Resulting in: `M2 < Mdart < Mjs`
357
356
358
357
#### Goal for Angular
359
358
360
359
| Goal ||
361
-
|---------|-------|
360
+
|---------|---------------------------------|
362
361
| Purpose | Lower |
363
362
| Issue | The barrier |
364
363
| Object | For contributing towards Angular (2.0) |
@@ -443,7 +442,8 @@ An application called `cloc` is used to count the number of lines of code and th
@@ -478,7 +478,9 @@ Finally, general checking metrics are needed to define whether the goal, namely
478
478
***Mapping**: Monitoring the number of contributors, to see if this increases
479
479
480
480
This metric is performed and obtained from GitHub, with the results depicted in the following graph:
481
-

481
+
482
+

483
+
_Number of contributors_
482
484
483
485
The number of contributors reached a peak in November 2014, and has steadily declined. This might be just because of start of the AngularJs 2.0, the new framework.
0 commit comments