|
1 |
| -## Описание |
| 1 | +## Description |
2 | 2 |
|
3 |
| -framework.js - небольшая часть фреймворка, необходимая для демонстрации IoC |
4 |
| -application.js - часть приложения для демонстрации IoC |
| 3 | +`framework.js` - small piece of the framework, just to demonstrate IoC |
| 4 | +`application.js` - small piece of the application, also for IoC demonstration |
5 | 5 |
|
6 |
| -## Запуск |
| 6 | +## How to execute |
7 | 7 |
|
8 |
| -Из командной строки можно набрать `node ./framework.js` или `node framework` |
| 8 | +From the command line, type: `node ./framework.js` or `node framework` |
9 | 9 |
|
10 |
| -## Задания |
| 10 | +## Tasks |
11 | 11 |
|
12 |
| -1. Пробросить в контекст приложения setTimeout и setInterval и использовать их, |
13 |
| -выводя console.log() с таймера |
| 12 | +You may select at least one of the following tasks, make a fork of this |
| 13 | +repository and implement your solution there. If those tasks are simple |
| 14 | +for somebody, please see additional tasks below. |
14 | 15 |
|
15 |
| -2. Пробросить в контекст приложения библиотеку util и сделать вызовы нескольких |
16 |
| -ее функций из приложения |
| 16 | +1. Add `setTimeout` and `setInterval` to the application context and use them |
| 17 | +printing something from the timer function using console.log() |
17 | 18 |
|
18 |
| -3. Сделать возможность запускать фреймворк с разными приложениями, через |
19 |
| -параметр командной строки: `node framework <applicationName>` |
| 19 | +2. Inject a link to `util` library into the application context and make a few |
| 20 | +calls to its functions from applied code |
20 | 21 |
|
21 |
| -4. Обернуть вызов console.log() в песочнице приложения, чтобы добавить в вывод |
22 |
| -дополнительные данные: `<applicationName> <time> <message>` |
| 22 | +3. Implement the ability to run different applications inside framework, using |
| 23 | +command line option, e.g.: `node framework <applicationName>` |
23 | 24 |
|
24 |
| -5. Обернуть вызов console.log() в песочнице приложения, для дублирования записи |
25 |
| -в файл в формате: `<applicationName> <time> <message>` |
| 25 | +4. Wrap or intercept `console.log()` call to add more info into console output |
| 26 | +in the following format: `<applicationName> <time> <message>` |
26 | 27 |
|
27 |
| -6. Пробросить в приложение `require` и обернуть в песочнице для логирования, |
28 |
| -вызывать и логировать вызовы в файл в формате: `<time> <module name>` |
| 28 | +5. Wrap or intercept `console.log()` in the sandboxed application logging all |
| 29 | +console output into a file in the format: `<applicationName> <time> <message>` |
29 | 30 |
|
30 |
| -7. Экспортировать из приложения хеш с несколькими функциями и переменными и |
31 |
| -распечатать их список из фреймворка с указанием типов |
| 31 | +6. Give a link to `require` function to the application, add call to it and |
| 32 | +wrap it for logging to a file in the format: `<time> <module name>` |
32 | 33 |
|
33 |
| -8. Экспортировать из приложения функцию и распечатать список ее параметров |
34 |
| -из фреймворка (начать с вывода тела функции) |
| 34 | +7. Export a hash from `application.js` with multiple functions and variables, |
| 35 | +print the list with types from framework |
35 | 36 |
|
36 |
| -9. Распечатать из приложения список всего, что находится в его глобальном |
37 |
| -контексте (т.е. в песочнице приложения) с указанием типов данных |
| 37 | +8. Export a function from `application.js` and print a list of its parameters |
| 38 | +form the framework (you can start printing function source) |
| 39 | + |
| 40 | +9. Print a list of everything from the application global context (application |
| 41 | +sandbox) with the data types specified |
| 42 | + |
| 43 | +10. Compare an application sandboxed context keys before application loaded and |
| 44 | +after, print it from the framework and find a difference (keys added / deleted) |
| 45 | + |
| 46 | +## Additional tasks |
| 47 | + |
| 48 | +11. You can combine several tasks (listed above) in your code, implement a more |
| 49 | +complex example of interaction between framework and application, preparing |
| 50 | +run-time environment (sandbox) and/or improving CLI (command line interface) |
| 51 | + |
| 52 | +12. Implement a similar example in another programming language |
| 53 | + |
| 54 | +13. Improve and/or optimize Impress Application Server code, specifically |
| 55 | +everything related to sandboxing, see: |
| 56 | +[/lib/impress.application.js](https://github.com/tshemsedinov/impress/blob/master/lib/impress.application.js) |
| 57 | + |
| 58 | +14. Use IoC and code isolation principles using sandboxed context and/or other |
| 59 | +similar technique in your projects (any technological stack) to demonstrate its |
| 60 | +use and the effect of such use |
0 commit comments