Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put note about class-side initialization of TBBlog - chapter 4 #18

Open
Bajger opened this issue Aug 12, 2022 · 4 comments
Open

Put note about class-side initialization of TBBlog - chapter 4 #18

Bajger opened this issue Aug 12, 2022 · 4 comments

Comments

@Bajger
Copy link

Bajger commented Aug 12, 2022

There should be a note in chapter 4 about class side initialization of TBBlog class. Since it is invoked explicitly by user, class is initialized (and Mongo memory DB) only when this initialized method is called by user. Therefore note to Save image right after initialization in order to persist state of DB, otherwise DB won't be initialized next time image is opened.
Current state:

The ==reset== class method re-initializes the database. The ==initialize== class method ensures that the database is initialized when we load TinyBlog's code. Do not forget to execute expression ==TBBlog initialize== to ensure that the database is initialized.

Proposal to add right after that:
Note: Please save your image right after you evaluated initialize method. Class side initialization is done only when explicitly evaluated by user. Therefore TBBlog initialization might be lost, if you quit the image without saving changes.

@hogoww
Copy link

hogoww commented Aug 12, 2022

For additional details, see this discord post which initialized this issue:
https://discord.com/channels/223421264751099906/359632451674570754/1007534503461392404

@Ducasse
Copy link
Member

Ducasse commented Aug 12, 2022

Thanks I will have a look.
If you have a suggestion for the place it will help me.

@Bajger
Copy link
Author

Bajger commented Aug 12, 2022

I would add note right after this line:

The ==reset== class method re-initializes the database. The ==initialize== class method ensures that the database is initialized when we load TinyBlog's code. Do not forget to execute expression ==TBBlog initialize== to ensure that the database is initialized.

@Ducasse
Copy link
Member

Ducasse commented Aug 12, 2022

Thanks a lot!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants