Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Molecule is a Pharo component framework.

License

NotificationsYou must be signed in to change notification settings

OpenSmock/Molecule

 
 

Repository files navigation

Molecule Logo

Molecule is a component oriented framework for Pharo.His Component architecture approach provide an adapted structuration to graphic user interface (GUI) or another software application wich need Component features.

Molecule provide a way to describe a software application as a components group. Components communicate by use of services, parameters and events propagation. It is a Pharo implementation of the Lightweight Corba Component Model (Lightweight CCM).Molecule support completely transparent class augmentation into component (not necessary to add code manually), based on Traits.

Getting Started

Installing Molecule

Pharo 9, Pharo 10 and Pharo 11 (build 269+) :

Metacellonewbaseline:'Molecule';repository:'github://OpenSmock/Molecule';   load.

Pharo 8 : Last supported release for Pharo 8 is1.2.6, newer versions are not supported but may be works.

Pharo 6 and 7 : Deprecated version of Molecule (1.1.x) for Pharo 6 and 7 is availablehere.

Prerequisites

Molecule Core has no dependencies.Package 'Molecule-Benchmarks' requires SMark (https://github.com/smarr/SMark), this package contains benchmarks for working on performances.

UI Tools overview

UI Tools are comming in next versions of Molecule. They are currently in development in Incubators packages but are ready to use.

imagemoleculeUIToolsMoleculeIncubator_EditorTest

Installing Incubators packages for Pharo 10 :

Metacellonewbaseline:'MoleculeIncubator';repository:'github://OpenSmock/Molecule';   load.

Using Components

Start and stop method

Components can be used with the start & stop method.

To start a component :

component:=MyComponentClass start.

To stop a component :

MyComponentClass stop.

Component can be identified with a name. To start a component with a specific name :

componentA:=MyComponentClassstart:#componentA.

To stop a component identified by a name.

MyComponentClassstop:#componentA.

Component Life-cycle method

Components can be used with the life-cycle method, the two methods (start & stop, life-cycle) can be combined.

Start a component is equivalent to :

MyComponentClass deploy.component:=MyComponentClass instanciate.MyComponentClass activate.

With a name :

MyComponentClass deploy.componentA:=MyComponentClassinstanciate:#compA.MyComponentClassactivate:#compA.

Stop a component is equivalent to :

MyComponentClass passivate.MyComponentClass remove.MyComponentClass undeploy.

With a name :

MyComponentClasspassivate:#compA.MyComponentClassremove:#compA.MyComponentClass undeploy.

Some examples

Examples are available in the package 'Molecule-Examples'.Before running examples open the Transcript, some results are showed on the Transcript window.

Clock System example

MolMyClockSystem startAlarmExample.

This system uses 4 components: a server time send global hour to a clock. The clock send local hour to alarms and to final user (which could be an UI). The final user can change the parameters of the system as alarm time or set manual time for the clock. The alarm is subscribed to clock time, and sounds when it is time.

This system provides a global example of the use of components.

GPS example

MolGPSExampleLauncher start.

More details about examples in the comment of MolGPSExampleLauncher.

First we program a component application that connects to a Global Positioning System (GPS) hardware and displays the GPS data on a view map (just fictitious).The GPS data and view map are implemented as Molecule components.In a second way, we reuse an existing non-component class in our Molecule application (MolGPSHardware).To do so, we augment this class with component behavior.

Test coverage

Molecule includes more than 250 unit tests, we have also written tests that simulate the work of a developer when creating and modifying components. Test coverage is detailed in the release notes.

Credits

Molecule Logo

License

This project is licensed under the MIT License - see theLICENSE file for details.


[8]ページ先頭

©2009-2025 Movatter.jp