{"id":15495045,"url":"https://github.com/samchon/framework","last_synced_at":"2025-09-18T16:30:40.353Z","repository":{"id":35561092,"uuid":"39832985","full_name":"samchon/framework","owner":"samchon","description":"Deprecated, use TGrid instead","archived":false,"fork":false,"pushed_at":"2020-01-18T09:07:02.000Z","size":155142,"stargazers_count":71,"open_issues_count":0,"forks_count":24,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-01-03T12:19:41.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tgrid.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samchon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T12:38:14.000Z","updated_at":"2023-09-25T10:24:05.000Z","dependencies_parsed_at":"2022-08-30T03:20:59.112Z","dependency_job_id":null,"html_url":"https://github.com/samchon/framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fframework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fframework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fframework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fframework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samchon","download_url":"https://codeload.github.com/samchon/framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233497392,"owners_count":18685052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T08:15:54.020Z","updated_at":"2025-09-18T16:30:35.020Z","avatar_url":"https://github.com/samchon.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Samchon Framework\n[![npm version](https://badge.fury.io/js/samchon.svg)](https://www.npmjs.com/package/samchon)\n[![Downloads](https://img.shields.io/npm/dm/samchon.svg)](https://www.npmjs.com/package/samchon)\n[![DeepScan Grade](https://deepscan.io/api/projects/1803/branches/7815/badge/grade.svg)](https://deepscan.io/dashboard/#view=project\u0026pid=1803\u0026bid=7815)\n[![Chat on Gitter](https://badges.gitter.im/samchon/framework.svg)](https://gitter.im/samchon/framework?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\n\n\n\u003e ## Deprecated, use [TGrid]((https://github.com/samchon/tgrid)) instead.\n\u003e [**TGrid**](https://github.com/samchon/tgrid) - TypeScript Grid Computing Framework \n\u003e\n\u003e I've found a much better solution for implementing the [OON](#object-oriented-network) by realizing the true Grid Computing through the [RFC](https://github.com/samchon/tgrid#13-remote-function-call). [**TGrid**](https://github.com/samchon/tgrid) is a new framework for the solution. Therefore, [**TGrid**](https://github.com/samchon/tgrid) will replace this **Samchon Framework** and continue \n\u003e developing the [OON](#object-oriented-network).\n\u003e \n\u003e #### [`composite-calculator/server.ts`](https://github.com/samchon/tgrid.examples/blob/master/src/projects/composite-calculator/server.ts)\n\u003e ```typescript\n\u003e import { WebServer, WebAcceptor } from \"tgrid/protocols/web\";\n\u003e import { CompositeCalculator } from \"../../providers/Calculator\";\n\u003e \n\u003e async function main(): Promise\u003cvoid\u003e\n\u003e {\n\u003e     let server: WebServer = new WebServer();\n\u003e     await server.open(10102, async (acceptor: WebAcceptor) =\u003e\n\u003e     {\n\u003e         await acceptor.accept(new CompositeCalculator());\n\u003e     });\n\u003e }\n\u003e main();\n\u003e ```\n\u003e \n\u003e #### [`composite-calculator/client.ts`](https://github.com/samchon/tgrid.examples/blob/master/src/projects/composite-calculator/client.ts)\n\u003e ```typescript\n\u003e import { WebConnector } from \"tgrid/protocols/web/WebConnector\";\n\u003e import { Driver } from \"tgrid/components/Driver\";\n\u003e \n\u003e import { ICalculator } from \"../../controllers/ICalculator\";\n\u003e \n\u003e async function main(): Promise\u003cvoid\u003e\n\u003e {\n\u003e     //----\n\u003e     // CONNECTION\n\u003e     //----\n\u003e     let connector: WebConnector = new WebConnector();\n\u003e     await connector.connect(\"ws://127.0.0.1:10102\");\n\u003e \n\u003e     //----\n\u003e     // CALL REMOTE FUNCTIONS\n\u003e     //----\n\u003e     // GET DRIVER\n\u003e     let calc: Driver\u003cICalculator\u003e = connector.getDriver\u003cICalculator\u003e();\n\u003e \n\u003e     // FUNCTIONS IN THE ROOT SCOPE\n\u003e     console.log(\"1 + 6 =\", await calc.plus(1, 6));\n\u003e     console.log(\"7 * 2 =\", await calc.multiplies(7, 2));\n\u003e \n\u003e     // FUNCTIONS IN AN OBJECT (SCIENTIFIC)\n\u003e     console.log(\"3 ^ 4 =\", await calc.scientific.pow(3, 4));\n\u003e     console.log(\"log (2, 32) =\", await calc.scientific.log(2, 32));\n\u003e \n\u003e     try\n\u003e     {\n\u003e         // TO CATCH EXCEPTION IS STILL POSSIBLE\n\u003e         await calc.scientific.sqrt(-4);\n\u003e     }\n\u003e     catch (err)\n\u003e     {\n\u003e         console.log(\"SQRT (-4) -\u003e Error:\", err.message);\n\u003e     }\n\u003e \n\u003e     // FUNCTIONS IN AN OBJECT (STATISTICS)\n\u003e     console.log(\"Mean (1, 2, 3, 4) =\", await calc.statistics.mean(1, 2, 3, 4));\n\u003e     console.log(\"Stdev. (1, 2, 3, 4) =\", await calc.statistics.stdev(1, 2, 3, 4));\n\u003e \n\u003e     //----\n\u003e     // TERMINATE\n\u003e     //----\n\u003e     await connector.close();\n\u003e }\n\u003e main();\n\u003e ```\n\u003e\n\u003e\u003e ```\n\u003e\u003e 1 + 6 = 7\n\u003e\u003e 7 * 2 = 14\n\u003e\u003e 3 ^ 4 = 81\n\u003e\u003e log (2, 32) = 5\n\u003e\u003e SQRT (-4) -\u003e Error: Negative value on sqaure.\n\u003e\u003e Mean (1, 2, 3, 4) = 2.5\n\u003e\u003e Stdev. (1, 2, 3, 4) = 1.118033988749895\n\u003e\u003e ``` \n\n\n## Outline\n### Object Oriented Network\n![Network Connectivity to Class Relationship](https://camo.githubusercontent.com/31ef65b5de55a38b52de5a1f1e797268d8e22c4a/687474703a2f2f73616d63686f6e2e6769746875622e696f2f6672616d65776f726b2f696d616765732f6163636573736f72792f6f6f6e2e706e67)\n\nSamchon Framework is an OON (Object-Oriented Network) framework. You can compose network systems within framework of the Object-Oriented. \n\nWhether how the network system is enormous and complicate, **the system nodes, they're just objects** in the Samchon Framework. Define \u003cu\u003eobjects who represent the *system nodes*\u003c/u\u003e and \u003cu\u003edeliver message by calling methods from objects to objects\u003c/u\u003e. That's all.\n\n### System Templates, Modules of OON\nI repeat, Samchon is an OON (Object-Oriented Network) framework, composing a network system within framework of the Object-Oriented. It means that even **modulization** is possible and it's called **System Templates**. You can maximize the **reusability** with the **modulization, System Templates**.\n\nWhen you need a cloud system, then take a System Template named [Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service). When you need a distributed processings system, then take the [Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed-System). If you should implement a specific network system and the network system will be used repeatedly, then **modulize** it to be one of the **System Templates**.\n\nBelow **System Templates** are basically provided in the Samchon Framework:\n\n  - [Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service): Cloud Server Template\n  - [External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External-System): A template for 1: N composite relationship's network system.\n    - [Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel-System): Parallel Processing System Template.\n    - [Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed-System): Distributed Processing System Template.\n\n### [TypeScript-STL](https://github.com/samchon/typescript-stl), interaction with TypeScript and C\\++\n[![Supported Languages](https://camo.githubusercontent.com/4cec4c0dde09984806b7a4353cba82e69dcd9bde/687474703a2f2f73616d63686f6e2e6769746875622e696f2f6672616d65776f726b2f696d616765732f6163636573736f72792f6c616e67756167655f6469616772616d2e706e67)](#interaction)\n\nThe best solution, for integrating and migrating a system built by different languages (TypeScript and C++), is to sharing same designs and grammers. Those designs and grammers are unitifed, then any other solution can't be better. Samchon Framework provides the best solution.\n\nUnifying designs, it can be come true by utilizing the **Object-Oriented Network** paradigm with Samchon Framework. Unifying grammer, it also can be done by using the [**TypeScript-STL**](https://github.com/samchon/tstl), a sub-project who migrated C\\++'s STL (Standard Template Library) to TypeScript. You can use STL's containers and algorithms in TypeScript with the [**TypeScript-STL**](https://github.com/samchon/tstl). Thus, you can unify not only designs but also grammers, algorithms and even data structures with the [**TypeScript-STL**](https://github.com/samchon/tstl).\n\n#### Suggestion\nIf you're planning to build a cloud solution, then I sugguest you to follow such step:\n  1. Fast Implementation\n    1. Cloud Application with TypeScript \u0026 HTML \n    2. Cloud Service with TypeScripty \u0026 NodeJS\n  2. Performance Improvement\n    1. Heavy processes, distribute them to C\\++ systems.\n    2. Migrate Cloud server from TypeScript to C++ gradually.\n\n\n## Installation\n#### TypeScript\n```bash\n# Install NPM module.\nnpm install --save samchon\n```\n\nInstalls Samchon-Framework from NPM module and imports the definition.\n\n```typescript\n/// \u003creference types=\"samchon\" /\u003e\nimport samchon = require(\"samchon\");\n```\n\n#### C++\nSamchon Framework is a header only project. Linkages like LIB, DLL or SO are not required at all. **Just include header files what you want**. However, notice that, Samchon Framework has two dependencies you should install.\n  - [Boost](http://www.boost.org) - essential.\n  - [ODBC](https://en.wikipedia.org/wiki/Open_Database_Connectivity) - optional, required only when using SQL driver.\n\n```cpp\n#include \u003csamchon/library.hpp\u003e\n#include \u003csamchon/protocol.hpp\u003e\n\n#include \u003csamchon/templates/service.hpp\u003e\n#include \u003csamchon/templates/external.hpp\u003e\n#\tinclude \u003csamchon/templates/parallel.hpp\u003e\n#\tinclude \u003csamchon/templates/distributed.hpp\u003e\n```\n\n\n## Documents\n#### Architecture Designs\n  - Class Diagrams\n    - [TypeScript](http://samchon.github.io/framework/design/ts_class_diagram.pdf)\n    - [C++](http://samchon.github.io/framework/design/cpp_class_diagram.pdf)\n  - [Conceptual Diagram](http://samchon.github.io/framework/design/conceptual_diagram.pdf)\n  - [Sequence Diagram](http://samchon.github.io/framework/design/sequence_diagram.pdf)\n\n#### Guide Documents\n  - [TypeScript](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components)\n  - [C++](https://github.com/samchon/framework/wiki/CPP-Protocol-Basic_Components)\n  - [Examples](https://github.com/samchon/framework/wiki/Examples-Interaction)\n  \n#### API Documents\n  - **v2.0**\n    - [**TypeScript**](http://samchon.github.io/framework/api/ts)\n    - [__C++__](http://samchon.github.io/framework/api/cpp)\n  - v1.0\n    - [C++](http://samchon.github.io/framework/api/v1.0/cpp)\n    - [Flex](http://samchon.github.io/framework/api/v1.0/flex)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fframework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamchon%2Fframework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fframework/lists"}