Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Move some GUI code from sdk to src

<< < (2/10) > >>

oBFusCATed:

--- Quote from: MortenMacFly on April 08, 2013, 08:24:22 pm ---Sure - There should an can only be one project manager..?!

--- End quote ---
Why? What if I want to have two workspaces loaded?
And by the way this is not a technical reason.

MortenMacFly:

--- Quote from: oBFusCATed on April 08, 2013, 08:29:48 pm ---Why? What if I want to have two workspaces loaded?

--- End quote ---
Why would you want to do that? The design is 1 workspace with n projects with m targets. Do you want to change that? Why? I don't know any software that supports more that one WS opened.


--- Quote from: oBFusCATed on April 08, 2013, 08:29:48 pm ---And by the way this is not a technical reason.

--- End quote ---
Nut sure what you mean - but well: There is never a strict technical reason for a singleton pattern. Its more enforcing discipline for developers. Its a design pattern - full stop. You can (of course) question design patterns... ??? Start by writing an email to Erich Gamma... ;-)

oBFusCATed:
A technical reason would be if we want to have proper initialization before the "main" function call.
Otherwise a singleton is just a glorified global variable.

Anyway, I've just being wondering about it. Because the Manager/Singleton stuff makes the code a bit messy and tightly coupled.

BTW: Here is a first patch of the extraction of the UI code from ProjectManager: http://cmpt.benbmp.org/codeblocks/patches/no_ui/0001-sdk-Start-the-extraction-of-the-UI-related-code-from.patch

killerbot:
hmm, and a war on singletons is starting ;-)

I do agree, it would be better to not have a singleton, and pass a reference to the resource.
Makes things more explicit, and is also beneficial for testing purposes and one reduces coupling.

So it is a refactoring which improves the code quality.

oBFusCATed:

--- Quote from: killerbot on April 08, 2013, 09:08:11 pm ---hmm, and a war on singletons is starting ;-)

--- End quote ---
No, because it will take years to remove them.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version