Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 02/09/19 in all areas

  1. Original post: https://www.thedelphigeek.com/2019/02/design-patterns-with-delphi-book.html Hurrah, hurray, my third book is here! It’s called Hands-On Design Patterns with Delphi and (just like my first book) I wrote it for Packt Publishing. (The second book was self-published and I expect the fourth one to be, too.) As the name says, “Design Patterns with Delphi” deals with design patterns. It is a bit different from most of design pattern books and websites you will find on the Internet. Case in point A: There are no UML diagrams. I don‘t speak UML. Tried to learn it few times but for some reason the whole concept doesn‘t agree with me. If you like diagrams, don’t fear though. Any book on design patterns - and most websites covering that topic - will gladly show how any design pattern can be diagrammed. That, however, is not important and should not govern your decision to buy the book. More important is case in point B: This book speaks Delphi. All the examples are written in Delphi and language features are used to the full. I also covered few less known Delphi idioms in separate sections. You’ll still be able to follow the discussion even though you may program in a different Pascal dialect. There’s also case in point 😄 Examples make sense. I deeply dislike classical design pattern examples of the “And then we want to write this program for different toolkits and it should also be able to draw circles, not only squares” kind. Euch! I tried to find a good example for each design pattern. Admittedly, I ended with few examples that draw triangles and squares on screen (mostly because some patterns were designed specifically for solving such problems), but most of them are of a more practical nature. This book covers all three classical design pattern categories - Creational patterns, Structural patterns, and Behavioral patterns. It also discusses patterns from the newer Concurrency patterns category. At the end I threw in some borderline-pattern(ish) topics and ended with a discussion of few patterns that cannot be strictly classified as “design” patterns. In this book you’ll find: Chapter 1 An introduction to patterns. Exploration of design principles, design patterns, and idioms. A mention of anti-patterns. A short description of most important design principles. Delphi idioms: creating and destroying objects. Chapter 2 Creation patterns part 1. Singleton. Dependency injection. Lazy initialization. Object pool. Chapter 3 Creation patterns part 2. Factory method, Abstract factory, Prototype, Builder. Delphi idioms: Assign and AssignTo. Chapter 4 Structural patterns part 1. Composite. Flyweight. Marker interface. Bridge. Delphi idioms: comparers and hashers. Chapter 5 Structure patterns part 2. Adapter. Proxy. Decorator. Facade. Delphi idioms: replacing components in runtime. Also: helpers. Chapter 6 Behavioral patterns part 1. Null object. Template method. Command. State. Chapter 7 Behavioral patterns part 2. Iterator. Visitor. Observer. Memento. Delphi idioms: for .. in. Chapter 8 Concurrency patterns part 1. Locking. Lock striping. Double-checked locking. Optimistic locking. Readers-writers lock. Delphi idioms: tasks and threads. Also: bitwise operators. Chapter 9 Concurrency patterns part 2. Thread pool. Messaging. Future. Pipeline. Chapter 10 Writing Delphi programs. Event-driven programming. Actions. LiveBindings. Form inheritance. Frames. Data modules. Chapter 11 Wrapping it up. Exceptions. Debugging. Functional programming. I hope you will like this book and learn a lot from it. I know I did during the nine months I spent writing it. And if you find any bug in the code, let me know so I can correct it in the second release!
  2. Remy Lebeau

    First!

    I'm here!
  3. jbg

    IDE Fix pack for Rio

    Here is a new development snapshot of IDE Fix Pack for Rio. This version detects the WebInstaller and disables IDE Fix Pack inside the WebInstaller so that it doesn't crash the installer anymore. fastdccD103vDev.7z IDEFixPackD103RegDev.7z
  4. jbg

    IDE Fix pack for Rio

    And another development snapshot is available. This time the functions in StyleUtils.inc (Vcl.Styles) got optimized what makes the UI rendering faster. IDEFixPackD103RegDev.7z fastdccD103vDev.7z
  5. ByteJuggler

    Creating a "pull request" for jvcl

    Guys, while pulling updates from a remote repo is part of git (e.g. git pull from the command line for example), a "pull request" is not something intrinsically part of git, but something that github institutes, or that we agree between ourselves as developers. It literally is saying to someone else "Please {git} pull from me as I've got something you might want to review/use." It follows that in order for someone else to "pull" changes from you, that you must have some accessible place for them to pull from. Obviously users on the internet won't have access to your local repo on your developer PC, so they cannot pull from there. Nor would you normally be able to push to their repo (or their github repo) if that is where you originally pulled from (unless you're one of the project administrators/owners of course.) There therefore needs to some other repo, that must belong to you and is accessible so that someone else can pull from, that you can also first push to. (Just like there needs to be a shared SVN server, say, if you want another dev to get some changes you've made and are using subversion.) And this is where github comes in. It provides an easy to access place where you can fork and create your own remote repositories (from others) that are therefore just as easily accessible by others too. All that background is to help you understand the following: The normal process for working on github, if you want to contribute changes, is to 1.) Fork the repo of the project you want to contribute to in your github account. This creates a cheap remote repo (think "my own SVN server at github" if that helps) that belongs to you, than you can push to. 2.) Clone this fork (your own copy of this github repo) to your local PC. 3.) Do your work, commit locally. Once totally happy, git push, which obviously goes to your own remote repo (from the fork.) 4.) Now you're a few revisions ahead of the original repo, and you can then tell the original upstream repo maintainers that you'd like them to pull from your repo as you've got changes to fix some issue or whatever. In github, you do this by simply clicking "New Pull request" button in github. Hope that helps! Edit: By the by, if you've previously pulled from someone else's project directly, made some changes and now want to push this somewhere else, it's quite easy to fork the project "after the fact" and then tell git/update that "remote"/"upstream" is now else, to e.g "push" to your fork instead. (It's also possible to have multiple remotes if you want, but I digress...)
  6. Hi, I've had lots of enquiries recently about when Bookmarks and Navigator will have a version available for 10.3 - they've been updated and new features added for every release until now. I'm please to say they will be available with the upcoming version of RAD Studio (10.3.1) which is coming out soon. The reason for for being included, and for the lack of news about a 10.3-compatible release in the past month, is that the plugins have been acquired by Embarcadero and so will now ship with the IDE itself. This is great news. I wrote the plugins originally to add features I wanted to the IDE, and hundreds (thousands, actually!) of developers have given great feedback. It's great to know the features will be available to everyone. In addition, due to the pressures of work, I haven't had much time to maintain or extend them recently, and so having them under Embarcadero's wing means they'll live on and be developed as part of Delphi and C++Builder itself. More info in the linked post! - David
  7. I have started a new ICS release V8.60, not finished yet but available from SVN and the daily overnight zipped snapshot at : http://wiki.overbyte.eu/wiki/index.php/ICS_Download V8.60 is a major update added several new components and sample applications created by Magenta Systems Ltd and previously distributed separately to the ICS distribution. Bundling them with ICS makes installation and updating easier, and allows existing ICS samples to make use of some the new components, such as UTF-8 file logging. There are a lot of comments in the various SVN uploads which are included in the overnight zip file. New classes added include: TIcsBlacklist TIcsBuffLogStream TIcsFindList TIcsIpStrmLog TIcsMailQueue TIcsStringBuild TIcsTimeClient TIcsTimeServer TIcsWhoisCli and there are four new sample applications that illustrate their use: OverbyteIcsMailQuTst.dpr OverbyteIcsIpStmLogTst.dpr OverbyteIcsWhoisCliTst.dpr OverbyteIcsTimeTst.dpr Also there are major updates to OverbyteIcsSslMultiWebServ.dpr which now has almost all the functionality of my commercial web server. V8.60 will also include the Magenta File Transfer components, not finshed yet. Angus
  8. I got it working now! First I changed the path setting back to the old value (on my machine it is "c:\Users\Uwe\AppData\Roaming\Parnassus OU\Common"). Then I copied the new DLL into that folder and renamed it to ParnassusCoreEditor_XRio.dll It seems that the DLL loader logic first looks for the "XRio" DLL and has a fallback to the original name. That way the different DLLs can coexist in the same folder and the XRio renaming allows for future version, too.
  9. It always depends on particular situation. Both composition and inheritance have their place. Sometimes you can use either, sometimes there is a clear distinction. Some tips that can help you decide. IS-A - inheritance - Sword IS-A Weapon so Sword should inherit Weapon HAS-A - composition or aggregation - Unit HAS-A Weapon so Unit can be composed with Weapon object With simple classes that satisfy IS-A condition plain inheritance will do. With more complex classes, you may want to use composition or delegate some behavior to other classes, especially if that behavior can be reused independently. Delegation - delegate behavior to another class when it is not an objects responsibility to implement behavior on its own Composition - when object is gone the composed objects are also gone - when Pizza is gone so are the ingredients Aggregation - class is used as a part of another class, but still exists outside that other class - when Unit dies Weapon still exists
  10. The GExperts Grep Search expert has various options to tell it which files to search: The current file All files in project All files in project group A directory list (separated by semicolon) That sounds like an exhaustive list, but it isn’t. Both, project and project group, were only searching files explicitly listed in the project(s). Files that were linked into the project using the search path, were not searched. Until now, that is: There is now an option to use the MAP file instead of the DPR file for project search. https://blog.dummzeuch.de/2019/03/03/gexperts-grep-can-use-the-map-file/
  11. Welcome Everyone! Welcome to this forum intended for ICS support. Feel free to ask your ICS questions here. Before asking, search this forum and also check http://wiki.overbyte.be Please stay on topic. Use other forums for subjects not directly related to ICS. --- François PIETTE The author of the freeware Internet Component Suite (ICS) The author of the freeware multi-tier middleware MidWare http://www.overbyte.be
  12. Remy Lebeau

    Check for override

    To expand on Anders' comment - the TStream.Seek() method has two overloads, one for 32-bit seeks and one for 64-bit seeks. By default, the 32-bit Seek() calls the 64-bit Seek() and vice versa. Descendants must override one of the Seek() methods and the override must not call the inherited method. To avoid an endless recursive loop, the 32-bit Seek() validates that the 64-bit Seek() method has been overridden before calling it. This is the technique that it uses for that validation: procedure TAncestor.Do(); type TMethodXType = procedure of object; // must match the signature of MethodX... var Impl: TMethodXType; Base: TMethodXType; ClassTAncestor: TClass; begin Impl := MethodX; // points to descendant's implementation of MethodX... ClassTAncestor := Self.ClassType; // get object's actual class type... while (ClassTAncestor <> nil) and (ClassTAncestor <> TAncestor) do // find the TAncestor base class... ClassTAncestor := ClassTAncestor.ClassParent; Base := TAncestor(@ClassTAncestor).MethodX; // points to TAncestor's implementation of MethodX... if TMethod(Impl).Code = TMethod(Base).Code then // which MethodX implementation is the object actually using? begin // MethodX is NOT overriden... end else begin // MethodX IS overriden... end; end;
  13. Lars Fosdal

    Recursive anonymous functions

    You should read this post
  14. You have a problem so you decide to use threads. you problems.2 have Now
  15. Delphi/Rad Studio desperately needs a proper package/library/component manager. A package manager provides a standardized way of consuming third party libraries. At the moment, use of third party libraries is very much adhoc, and in many cases this makes it difficult to move projects between machines, or to get a new hire up and running quickly. Other development eco systems, like Ruby, .net and Javascript, recognised and solved this problem many years ago. Getting a Ruby, .net or Javascript project up an running, in a new working folder or new machine is trivial. Delphi Package Manager RFC
  16. johnnydp

    10.3.1 has been released

    Actually it's "EMB" text compression, probably they should patent it and proudly add in About product information. Much better than LZ4, LZO or LZMA, because it's 3d multilayer
  17. There are a few things that every single one of our internal programs should do: Every dialog should be sizeable if it makes any sense at all. Delphi makes that easy with the Align and Anchor properties. Ask yourself the following questions. If you answer any of them with Yes, ... https://blog.dummzeuch.de/2019/04/03/things-that-every-desktop-program-should-do/
  18. Bill Meyer

    SVG Magic released

    Having worked in Delphi since D1, and twice having had to deal with the issue of components without source, I would say that the value without source is essentially zero, as the risk factor is not worth any benefits in the short term. So I would suggest that the question as you ask it is simply wrong.
  19. Martin Sedgewick

    IDE Fix pack for Rio

    https://andy.jgknet.de/blog/2019/03/ide-fix-pack-6-4-released/ Changelog Fixed: Packages with duplicate units may not have caused a fatal compiler error. Added: Support for Delphi 10.3 Rio Added: StyleUtils.inc performance optimizations for faster UI rendering (D10.3) Added: Infinite loop detection in TDebugger.UpdateEventLog Added: Fix for TStringList.IndexOfName bug (RSP-21633) Added: Fix for access violation in the Welcomepage JScript9.dll binding Added: TCustomListBox.ResetContent is skipped if the handle isn’t created yet Added: More STRINGCHECKS-free RTL code (2009/2010) Added: More DFM Streaming optimizations Added: RTL and DFM streaming patches to remove STRINGCHECKS (2009/2010) Added: Removed VclFixPack OutputDebugString calls (2009) Added: FillChar uses Enhanced REP MOVSB/STOSB cpu feature if available for large sizes. Added: Enabled CPU LOCK string assignment optimization for local variables Added: -Oe (experimental optimizations) and -x-cgo compiler option extension Added: CodeGen: Remove of some unnecessary push/pop operations Added: Expression Evaluator allows array access to pointers even if the type wasn’t declared with {$POINTERMATH ON} Added: Max number of constants in a function was increased from 64K to 16M (2009-XE3) Added: New compiler option extensions: -x–compileonly, -x–reslist, -x–depfile, -x–unitstats Added: More performance optimization for the DCC64 compiler Added: TStringBuilder.SetLength optimization [RSP-19178] (XE+) Added: TStrings.GetDelimitedText optimization Improved: Slight faster TStringList.IndexOfName optimization for sorted string lists.
  20. Uwe Raabe

    10.3.1 has been released

    It is my experience that issues with the installation are usually targeted quickly. I know what you mean, but if we stop filing bug reports to notify them about existing stuff not working they will have more time to add unwanted features. Even if the chances for a filed bug to be fixed are pretty low, they are still higher than those for a bug not filed at all. After all 10.3.1 fixes more than 150 reported bugs, which were probably still not fixed if they weren't be reported in the first place.
  21. jeanmilost

    SVG Magic released

    Hi developers, Have you ever encountered problems because your interface changes with high DPI but your images remains on the same size? Have you ever wanted to add incredible animations to your interface, but have been frustrated by the limited possibilities of the proposed image formats? So there is a library for you. SVG Magic brings the support of the Scalable Vector Graphics (SVG) image format to the C++ and Delphi VCL. Please visit: https://svgmagic.io/
  22. Dany Marmur

    Decorating read-only controls

    I so so agree with "In terms of UX, copying into clipboard should be taken into account." and the image. This used to work very good back when. Then - enters the designers. If it isn't Win10 native messing something up it's skins. DevExpress even have some skins that show a gray-box for readonly and some skins that do not and they refuse for years to do anything about it because it was "the vision of the designer". Such important functionality. If corrupt legislation and greed won't kill IT, designers will.
  23. Dalija Prasnikar

    10.3.1 has been released

    To some extent theming has a purpose because without it you could not have dark theme. Problem here is that Delphi (VCL Styles) based theming is just horrible since day one (even before it was introduced in IDE). Instead of VCL Styles being fixed and then used at large, EMBT choose to use VCL Styles without fixing issues. Another problem is not that just in theming itself, but revamping Options dialog layouts without making proper alignment/size adjustments - so everything visually just falls apart.
  24. Sherlock

    10.3.1 has been released

    I really don't get the whole theming bull anyway. I set my windows to look exactly the way I want it, and along comes some wannabe designer and imposes his take on what a GUI should look like. Most of the time it's just hilarious, but when I have to work with a tool (yes a tool) I want it to be as unobtrusive as possible and just do it's thing. If i want glitter on a hammer I will buy glitter and stick it on there myself. Don't expect everyone to like glitter an a hammer. Jeeeez! </Rant>
  25. Stefan Glienke

    Rapid generics

    System.Generics.Collections does not cause that much of a code bloat since the refactorings in XE7 - however it still causes more than it should but that is the limitation of the compiler. I did some tests with Rapid.Generics and while they are optimized for some scenarios it was not a stellar improvement over System.Generics.Collections in 10.3. And while I was doing benchmarks of those and Spring4D collections I saw that isolated benchmarks are often very much affected by certain CPU specifics - on different CPUs depending on their (non documented) behavior of the branch predictor and of course in a microbenchmark chances are high that all code fits into at least L2 cache.
×