Project Refactoring -- Please test it

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Project Refactoring -- Please test it

marcel.taeumel
Hi, there!

Please find attached a somewhat larger refactoring of Squeak's project mechanism. It can be applied to the latest trunk version.

projects-refactoring-may.5.cs

It's goals were to:
- Reduce the code footprint of new project kinds
- Move several MVC- or Morphic-specific parts from the base system to their respective packages
- Refactor several dependencies on global state/variables in MVC and Morphic
- Add support to delete projects that have sub-projects
- Improve error handling of severe UI errors such as messing around in LazyListMorph >> #drawOn:
- Allow parent projects that have a different code base (i.e. are of a different project kind) to act as fall-back environment before using the emergency REPL (Object >> #primitiveError:).

I will provide you with an additional third project kind of play around with in a few days. It will illustrate the simple means in Squeak to write a new user interface from scratch.

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Project Refactoring -- Please test it

David T. Lewis
On Sun, May 01, 2016 at 09:41:51AM -0700, marcel.taeumel wrote:

> Hi, there!
>
> Please find attached a somewhat larger refactoring of Squeak's project
> mechanism. It can be applied to the latest trunk version.
>
> projects-refactoring-may.5.cs
> <http://forum.world.st/file/n4893158/projects-refactoring-may.cs>  
>
> It's goals were to:
> - Reduce the code footprint of new project kinds
> - Move several MVC- or Morphic-specific parts from the base system to their
> respective packages
> - Refactor several dependencies on global state/variables in MVC and Morphic
> - Add support to delete projects that have sub-projects
> - Improve error handling of severe UI errors such as messing around in
> LazyListMorph >> #drawOn:
> - Allow parent projects that have a different code base (i.e. are of a
> different project kind) to act as fall-back environment before using the
> emergency REPL (Object >> #primitiveError:).
>
> I will provide you with an additional third project kind of play around with
> in a few days. It will illustrate the simple means in Squeak to write a new
> user interface from scratch.


Hi Marcel,

I loaded the cs into my working trunk image, and it works well. This is a
very nice cleanup of the Project structure.

+1 for putting it into trunk.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: Project Refactoring -- Please test it

Chris Muller-3
In reply to this post by marcel.taeumel
> - Improve error handling of severe UI errors such as messing around in
> LazyListMorph >> #drawOn:

Classically, when an error in #drawOn: would occur, we draw a red box
with a X through it.  Is that changed?

Reply | Threaded
Open this post in threaded view
|

Re: Project Refactoring -- Please test it

marcel.taeumel
Hi Chris,

of course not. Try putting an error in LazyListMorph >> #drawOn:. Before and after the change set. See, what happens. :-)

Hint: The Morphic "yellow cross of death" has a serious flaw. After a single error, it aborts the drawing and forgets about the current damage. To recover to a stable state GUI state, we have to keep on redrawing the whole world until no further error occurs.

So, after putting an error into LazyListMorph >> #drawOn:, you cannot even open a debugger and hence the emergency REPL appears. Before the change set, you have to hit escape several times before reaching a stable state again.

Try it out. :-)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Project Refactoring -- Please test it

marcel.taeumel
Hi, there.

I plan to put the changes into trunk until the end of this next weekend if there are no serious bugs or other objections.

Here is what you can try out:

- Open an MVC project inside a Morphic project and vice versa.
- Close project views (these windows for projects in MVC and Morphic) with and without nested projects.
- Add a serious bug to Morphic (e.g. LazyListMorph >> #drawOn:) with or without having an MVC project as parent project
- Try "MVCProject removeProjectsFromSystem" from within either MVC or Morphic
- Try "MorphicProject removeProjectsFromSystem" from within either MVC or Morphic
- Try "Project current beTopProject"
- Try "Project current addProject: MorphicProject new"
- Try "MVCProject unloadMVC" from within a Morphic project
- This should not work: "MorphicProject unloadMorphic" from within an MVC project ... :-D

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Project Refactoring -- Please test it

David T. Lewis
On Tue, May 03, 2016 at 01:14:22AM -0700, marcel.taeumel wrote:
>
> - This should not work: "MorphicProject unloadMorphic" from within an MVC project ... :-D
>

Hi Marcel,

We should fix that :-)

Dave