Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: Controller vs Service vs private method on command object.

  1. #11
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Hi constv,

    this time I completely on your site - your put my architectural/programming paradigm in the words much better then I can do.

    But I still disagree with you concerning Dijkstra - he was awesome scientist but none of the software developer and all his words have to be taken with a (giant) grain of salt as far as they deal with something aside algorithms.

    Regards,
    Oleksandr

    Quote Originally Posted by constv View Post
    Shah,

    to answer your question, I would have to step back to the root of our other discussions about the basic architectural concepts, the definitions of Domain, services, etc.

    Your concept of Domain Objects differs from mine, or from the authors' of JPetStore, for that matter. I define a functional Domain as a combination of 1) business entities and 2) operations that may be performed over those entities. So far, our views are similar, I think. But when it comes to the implementation, I strongly disagree with the school of thought you seem to belong to. I am not saying it is bad, and I do believe that objects must encapsulate both data and behavior. However, I also believe that being an "object purist" is not necessarily a good thing. Not all functionality that may be applied to a class must live on that class. The most essential concept of the art and craft of software engineering - and the most disregarded, unfortunately - is the concept of de-coupling things that are better off managed separately. Not melting things together allows creating flexible software, it gives you options to use the same things in various contexts without having to repeat yourself, without creating more work and hurdles for yourself. "Object puritanism", or, perhaps "object zealotry", is a dangerous thing.

    There are reasons why the great Edger Dijkstra all but rejected the idea of OO! He once said:




    Now, let's not dismiss his point of view without thinking. Dijkstra spent all his professional life promoting elegance and correctness in programming, and he knew a thing or two about that! His contributions to Computer Science and programming languages are colossal! Every serious programmer absolutely must read Dijkstra's The Humble Programmer article (the ACM Turing Lecture) before they read any modern flavor-of-the-day books on coding practices and design patterns! That may open some people's eyes on what programming should be all about, what testing is really for (not for ensuring the absence of the bugs, if that's what you are tempted to say!) , and many other things...

    Of course, all of us here in this forum are devoted Java programmers, and we appreciate the value of good OO design. I can't speak for Dijkstra and interpret why exactly he personally disliked the idea of OO. Perhaps he saw the danger in the concept that could easily be misinterpreted and taken to the extreme? I'd completely understand that. I definitely disagree with the notion that any object should always be literally self-contained, which implies that it should store the business logic applied to it. I believe (and so do many others) that objects that represent entities must encapsulate their properties/attributes and only the behavior essential to the object's definition - without any business-specific operations that may or may not be applied to that entity. In other words, it is not appropriate to put application-specific business operation into an all-purpose entity. Things like that should be externalized. Therefore, my idea of domain entities is closer to your idea of a DTO or value objects, but not exactly that. I do believe that such entities must implement the kind of behavior without which the entity may not be considered valid and usable. For example, a UsZipCode class may implement zip validation, parsing of the input data, splitting the zip into 5-digit code, 4-digit extension, or representing itself in several different ways: 5-, 9-, or 11-digit code, etc. All of such functionality is essential to defining a US Zip Code concept but it has nothing to do with the world outside the class itself. Nothing in such Zip Code class depends on, or makes assumptions about, how the objects of the class will be used in applications. This is the most essential point that I am trying to make. The entity definitions must be decoupled from any external operations that may be performed on the entity instances. The necessity in such operations (use cases) may come and go, but the domain entity objects will remain what they are - regardless of how they used.

    That is why, I clearly separate the concept of a domain entity, and a domain service. Note that I said "domain service". That's because I see a service as a software module that implements use cases/operations in a particular functional domain. For example, the User service implements user-related use cases and operates on User domain entities. Therefore a DOMAIN concept covers both: entities and operations, but keeps the two separate.

    In your interpretation, the business operations and data are molded together, and then you add a notion of a pure VO/DTO. The advantage of my approach is that I can apply any necessary business logic at any time to my domain entity objects (that carry the data and the encapsulated behavior that only describes the nature of the object, without the business logic). I define the business operations in dedicated services that implement use cases. I can add or remove service operations, but the Domain Object model remains the same. I don't need a separate layer of DTOs, and, most importantly, it is absolutely valid to expose the domain entity objects to the presentation tier (controllers/presenters.) In fact, that is how it should be! And that's what you saw in JPetStore. For example, if you decide that your application needs to use a notion of a User with some of the user-management functionality, you add the User component (e.g. user.jar) as a dependency for your application. Your front-end actions/controllers are aware of the User class and other entity classes defined in that component. They are also aware of the UserService (or UserManager) class that implements some user management functionality. You have no problem injecting that manager instance into your front-end controller, so why would you object the Controller being exposed to the entity classes that are also defined by the same User component? (Remember, in other our discussions I explained how to package classes by functionality, not by type; if yo do that you will always end up with a single independent module that defines both the service API and entity objects.)

    So, there you have it. The Controller receives the application-specific form/command object and maps the data to the domain entity that is recognized by the service (manager), and makes the call to the business method on the service to execute the business operation. Very simple. No additional DTOs, no "gateways". It's nothing new. It's just all about separating things and responsibilities that do not necessarily belong together. It is ok to have a "manager/service" object vs. stuffing everything into a "domain [entity] object." Once you wire something in, you are stuck with that. You should never make assumptions about what operations will and should be performed on an object. A desk is a desk. You can't force everyone to use it in the same way. Some people use desks for work, for writing, for reading, some folks eat at their desks, some might want to do things you won't imagine... None of those behaviors have anything to do with the concept of a desk itself, even though they are often applied to desks... You get my point, right?

    Good discussions.

  2. #12
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default

    Oleksandr,

    I appreciate your posts. I think you may be taking Dijkstra's comments too literally. I agree with your point that requiring a mathematical proof of correctness for each and every piece of code is unrealistic, and I don't think that it was what Dijkstra advocated. The essence of Dijkstra's "Humble Programmer", and many other EWDs and interviews, was, specifically, the call for elegance and intellectual manageability of programs. Dijkstra advocated and encouraged writing software where it would be possible to mentally process each individual piece - even before it is completed in the form of code. Now, if you successfully split and organize a complex problem into an elegant set of simple mentally-manageable sub-tasks, the correctness of the solution might become obvious without a mathematical proof. Such proof would still be a requirement for critical algorithms, obviously, but not for programming web sites that sell pets, etc.

    Yes, Dijkstra's vision of a software developer was a far cry from what it means to be a SD today. The vast majority of SDs we see today have no Computer Science background - at all. Many SEs - and architects - I meet on my projects approach software development as an occupation where they are simply expected to use certain tools and follow a cookbook of some flavor-of-the-day(!) recipes. Instead of trying to understand the essential algorithms, data structures, the basics of the theory of computation, state machines, work-flows, etc. - all the essentials that could tremendously help one in envisioning and designing software correctly, they start by studying technologies! That is why we see scores of people who can talk for hours about things like JBoss, Seam, Struts, Hibernate, JMS, Spring (w/o necessarily understanding the philosophy and motivations behind this great framework), you name it... But they can't write code, period. They can name any pattern out there, but can't design code. It is really sad. And such "developers" write nothing but intellectually unmanageable code that requires months of testing, and endless maintenance. There are still very good SEs out there, and I have been fortunate to work with quite a few of them, who do write elegant easy to understand and manage code that, once in production, just works. So, I do believe that elegance and intellectual manageability are possible and should always be the ultimate goal. The sad truth, however, is that an average software developer today is just not capable of achieving that.

    Here are a couple of my other favorite Dijkstra quotes (hope you don't mind.)

    “Elegance is not a dispensable luxury but a factor that decides between success and failure. In this connection I gratefully quote from The Concise Oxford Dictionary a definition of "elegant", viz. "ingeniously simple and effective". Amen.”

    “Elegance has the disadvantage… that hard work is needed to achieve it and a good education to appreciate it.”

    Amen.

    Cheers,
    Constantine

  3. #13
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Hi Constantine,
    Quote Originally Posted by constv View Post
    ...I agree with your point that requiring a mathematical proof of correctness for each and every piece of code is unrealistic, and I don't think that it was what Dijkstra advocated.
    As far as I can remember it was, but I may be wrong as I have read his works about 30 years ago Probably, need to re-read.

    ... where it would be possible to mentally process each individual piece - even before it is completed in the form of code.
    Exactly what Dijkstra has done - as far as I know he never, ever wrote a piece of working code

    Now, if you successfully split and organize a complex problem into an elegant set of simple mentally-manageable sub-tasks, the correctness of the solution might become obvious without a mathematical proof.
    That's true, KISS is a great principle.

    Such proof would still be a requirement for critical algorithms, obviously
    Obviously, not - for 2 reasons
    1. Such proof may be just impossible (there are a lot of things that cannot be neither proved, nor contradicted)
    2. If possible, it may much more complicated then algorithm itself and as such more error-prune then algorithm itself. And proof typically is untestable.

    In such cases other approaches may be viable - e. g. implementing alternative algorithms and obtaining results by "voting".

    Yes, Dijkstra's vision of a software developer was a far cry from what it means to be a SD today.
    Sure, as his (purely imaginable) software developer never was intended to be mass-production software developer, rather computer scientist.

    The vast majority of SDs we see today have no Computer Science background - at all.
    From my experience the best developers have mathematical background ("pure" mathematic, not computer science).

    Many SEs - and architects - I meet on my projects approach software development as an occupation where they are simply expected to use certain tools and follow a cookbook of some flavor-of-the-day(!) recipes.
    For many projects it is more then enough (if they at least try to understand reasoning behind those receipts).

    Instead of trying to understand the essential algorithms, data structures, the basics of the theory of computation, state machines, work-flows, etc. - all the essentials that could tremendously help one in envisioning and designing software correctly
    Or, as I have seen much more often, overengineer it tremendously.

    , they start by studying technologies!
    Not so bad as far technologies do not become goals in and of themselves.
    The main reasons behind technologies is elimination of many problems and steps that otherwise need to envisioned, designed and implemented ...
    But they can't write code, period.
    Sopme of them. And it has almost nothing to do with background. I became convinced once and again that or a person can write usable code, or not, and any amount of education (save very initial one), experience, ... (name one yourself) can not change it. Able person can become better, really good, excellent ... . Unable is unable, sorry (like in a music, painting, ...) .

    Kind regards,
    Oleksandr

    who do write elegant easy to understand and manage code that, once in production, just works. So, I do believe that elegance and intellectual manageability are possible and should always be the ultimate goal.
    ...

    “Elegance has the disadvantage… that hard work is needed to achieve it and a good education to appreciate it.”
    Creeping elegance—which is related to creeping featurism and second-system effect—is the tendency of programmers to disproportionately emphasize elegance in software at the expense of other requirements such as functionality, shipping schedule, and usability. - from Wikipedia

    Regards,
    Oleksandr

  4. #14
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default

    I swear, Oleksandr, your posts, while very intelligent, in addition to many valuable points, contain some of the most outrageous examples of pure demagogy I have ever seen - no offense. Of course, CS degree doesn't guarantee anything. However the chances that a person who deliberately chose to spend 4-6 years of his/her life to study CS (or math!) might display more interest in learning, understanding, and applying the appropriate knowledge working in that field then someone who became a programmer almost by accident - only because it pays more than delivering pizzas with a degree in history or liberal arts... I have worked with a person who had a Philosophy degree from Yale. He was one of the best I had seen! But he was an exception to the rule...

    Creeping elegance—which is related to creeping featurism and second-system effect—is the tendency of programmers to disproportionately emphasize elegance in software at the expense of other requirements such as functionality, shipping schedule, and usability. - from Wikipedia
    Come on... You know better than this... It's just not fair to use something like this as an argument. This is not even serious. This "expert statement" confuses the elegance in software we are discussing with crafty "smart" trickery and so called "optimizations" that, indeed, hurt code readability and usability. That is NO elegance. That is incompetence! The same goes for your comment that people who know too much might over-engineer things... Any kind of over-engineering - to me - indicates a certain degree of incompetence or lack of experience, or, sometimes, even an inferiority complex! Of course knowledge in the wrong hands is dangerous! Who would argue with that? true competence is NOT to over-engineer, and that's what I have been saying all along.

    My point is that it takes hard work, talent, education, imagination, and creativity to be a good software engineer, to be able to create good software. The last but not least, it requires passion for the craft of Software Engineering. It's not that the idea of elegance and simplicity is a wrong idea. It is very difficult to achieve, yes. That's true, some people just don't have it. You are right on: it's the same with music, or any kind of art. The fact that so many people just don't get it right only proves my point: they are not good software engineers.

    I also very much agree with your "mass-production software" era comment. Continuing to use the comparison with the music field, this explains why the market is saturated with programmer equivalents of Britney Spears or the likes of her, or even worse...

    Regarding Dijkstra's proofing comments, here's another quote:

    "But one should not first make the program and then prove its correctness, because then the requirement of providing the proof would only increase the poor programmer's burden. On the contrary: the programmer should let correctness proof and program grow hand in hand."

    This - at least to me - has always meant one thing: design so that at any given step you know what exactly you are doing, don't write hundreds of lines of code first and then keep your fingers crossed hoping that it would work. Know that it will work.
    Last edited by constv; Feb 13th, 2009 at 12:05 PM.

  5. #15
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by constv View Post
    I swear, Oleksandr, your posts, while very intelligent, in addition to many valuable points, contain some of the most outrageous examples of pure demagogy I have ever seen - no offense.
    Sure they do - on purpose. You may consider it as my hobby.

    However the chances that a person who deliberately chose to spend 4-6 years of his/her life to study CS (or math!) might display more interest in learning, understanding, and applying the appropriate knowledge working in that field then someone who became a programmer almost by accident - only because it pays more than delivering pizzas with a degree in history or liberal arts... I have worked with a person who had a Philosophy degree from Yale. He was one of the best I had seen! But he was an exception to the rule...
    The problem is that CS people tend to put way too much attention to the technical and technological aspects of development, micro-tuning of the details and so on - instead on concentrating on problem content. And why have said "among the worst" - good CS peoples are really good, but bat not so good typically are much more stubborn then any other not so good what make them "worst of the worst".

    I would say that they do not generalize enough. Maths (which I proudly represent) ) typically do not suffer from this kind of problems.

    Come on... You know better than this... It's just not fair to use something like this as an argument. This is not even serious.
    Sure, it was not an argument, merely joke (while it is really from wikipedia).
    The same goes for your comment that people who know too much might over-engineer things...
    It is quite different things - too know a lot and to be able successfully apply this knowledge. And people with lot of knowledge but not enough experience and/or talent tend to apply the whole knowledge in one shot, making things way too complicated.
    true competence is NOT to over-engineer, and that's what I have been saying all along.
    Sure, can not agree more. And understanding and analytical skills are much bigger parts of competence then pure knowledge.
    My point is that it takes hard work, talent, education, imagination, and creativity to be a good software engineer, to be able to create good software. The last but not least, it requires passion for the craft of Software Engineering.
    Can not agree more.

    It's not that the idea of elegance and simplicity is a wrong idea. It is very difficult to achieve, yes.
    Which effectively makes it useless (or impracticable) for the wast majority of projects - it can be several times and finished with standard approaches in the time needed to find really elegant solution.

    It has to be reserved for the most challenging projects or even for the most challenging part of those projects according to 20/80 rule.

    Regarding Dijkstra's proofing comments, here's another quote:

    "But one should not first make the program and then prove its correctness, because then the requirement of providing the proof would only increase the poor programmer's burden. On the contrary: the programmer should let correctness proof and program grow hand in hand."
    It does not make it more realistic. To put it straight - "correctness proof" as was understood by Dijkstra in nothing more then pure nonsense - for many reasons bot theoretical and practical. Their discussion deserves not a few words in a post, but a series of articles.
    But the same strategy applied to the testing may do (and do) wonders.

    This - at least to me - has always meant one thing: design so that at any given step you know what exactly you are doing, don't write hundreds of lines of code first and then keep your fingers crossed ...
    It may be not so bad, there is only one problem - you not always (and to put it straight - in commercial SW development almost never) know in advance what exactly you have to achieve. Because requirements and goals are not merely moving, they are flying - in butterfly style.

    Kind regards,
    Oleksandr

  6. #16
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default


    Quote:
    It's not that the idea of elegance and simplicity is a wrong idea. It is very difficult to achieve, yes.
    Which effectively makes it useless (or impracticable) for the wast majority of projects - it can be several times and finished with standard approaches in the time needed to find really elegant solution.
    You are basically stating that any talentless idiot can and should be a software engineer, and therefore the good SE practices are useless because most of those people are not capable of following them! It's like saying that - when training musicians - selecting musically talented kids and teaching them to play piano is a useless approach. Instead, anyone should be given a piano and sent to a recording studio - since it's unrealistic to expect everyone to be talented musicians.

    My point is: if you are a far-sighted IT manager, filter out the ones that just don't cut it (the ones who will never learn because they lack talent, dedication, interest, intelligence, whatever...) Then define the priorities correctly: focus on creating quality software. You, on the other hand, seem to advocate hiring just about anybody and letting them do whatever they please - as long as they eventually can get the damn thing to work... Unfortunately, that's what often happens, and the results are usually just pathetic. A simple project (simple for any good SE) would often turn into a nightmare - with no end in sight. In my own experience, it takes significantly less time and effort to deliver elegant software to QA and Production than delivering a patchy, poorly-designed mess. ALWAYS. In fact, the latter, most often turns into never-ending projects. Bad programmers start coding first, think later. It's because they are constantly in the state of panic. They doubt their ability to deliver anything ever - in the first place. So, they are always in a hurry to show some - any - results. They skip the design (the thinking) part! Proper designs (elegant, clean, simple) don't work for people who should not be programmers in the first place. Everyone else must be taught to do the right thing, and they will soon see how efficient the process becomes. I am amazed that you are arguing with this! I usually see this kind of resistance from the people who try to justify their incompetence, but I can tell that you are clearly NOT one of those people. Perhaps, it's just the "hobby" you've mentioned that makes you do that...

    Of course, that brings us to the real problem: many "programmers" should be, in fact, doing something else instead of programming. This is a very unfortunate consequence of the mass-production software phenomenon you have mentioned. Since we can't solve the problem once and for all, it is up to individual IT managers (many of whom are just as incompetent to know better) to identify the good candidates, pay them what they deserve, and get their project done without glitches. The companies that don't do such selection will [continue to] suffer the consequences: the buggy software, never-ending projects, working in the fire-fighting mode late ours and weekends - on things that could have been successfully delivered by just a few good SEs, really fast, and for much less money than the organization blows on the project developed by the "average" SEs using the "standard approaches."

    A couple of years ago I was hired by a huge insurance company to work on a system previously developed by another [well-known] consulting company in a course of a year. They had paid that consulting firm ~$1M to develop that system. (Small peanuts for my client...but about $1M too much for the kind of product that was delivered.) When I arrived, the local programmers had been working on bug fixes for that system literally every day. Something would break every single day. It was a continuous sustaining effort, a full-time job for the IT department. Then the company needed to add support for a couple of new (but similar) products to the system and asked me to look into it. It turned out that the system was hard-wired to work only with the original set of products, and any small tweaks would result in the whole thing all but falling apart. Not to mention, the code was atrocious, incoherent, with just plain mistakes that indicated that the programmers didn't understand some of the very basic things about Java, programming, or architecture. I redesigned and completely implemented - from scratch - the whole system, in just over two months. It went into QA, and for the first 2 weeks they had found no bugs! I know, it is unusual, and normally I do expect QA to find bugs in my code, but this was an easy project to me.) Later the client called a couple of times with requests for minor adjustments. That's it. If I had done that project from the very beginning - not that other consulting firm, all it would have taken is a few months at a fraction of cost. Instead, the client paid my cost + $1M, and wasted a year, plus a bunch of grief having to deal with everyday bugs whose fixes produced more bugs every day... I am sure that those lousy programmers who wrote the original version also would justify their crap with time constraints, requirements that were not clear, deadlines, and other external factors that would make "clean" design "unrealistic." It's all nonsense! It is always just an excuse incompetent people use. Anyone who is competent, who is capable of producing quality software will tell you that thoughtful, elegant, and clean solutions always ensure a faster delivery. They also ensure minimal maintenance costs throughout the life-cycle of the software.

    I hope we are done discussing this...
    Cheers,
    C

  7. #17
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by constv View Post
    You are basically stating that any talentless idiot can and should be a software engineer, and therefore the good SE practices are useless because most of those people are not capable of following them!
    It is severe misinterpretation of my words.
    I said that for mass-production software it is enough to follow good software practices, you need not to be overly talented to create usable system.

    It's like saying that - when training musicians - selecting musically talented kids and teaching them to play piano is a useless approach. Instead, anyone should be given a piano and sent to a recording studio - since it's unrealistic to expect everyone to be talented musicians.
    It is rather as difference between average village smith and top-notch armorer. Existence of latter does not eliminate a need in a former.

    My point is: if you are a far-sighted IT manager, filter out the ones that just don't cut it (the ones who will never learn because they lack talent, dedication, interest, intelligence, whatever...) Then define the priorities correctly: focus on creating quality software. You, on the other hand, seem to advocate hiring just about anybody and letting them do whatever they please - as long as they eventually can get the damn thing to work...
    Purely your imagination - if there is a possibility way that you like is definitely preferable. But there are external constraints - there are existing employees that you can not fire due to contractual obligations and such, there are limited presence of people of desired quality on the job market, and so on, and so on. And you have job on hands that you have to perform on time on budget. So you have to use whatever you have in an optimal way.

    Unfortunately, that's what often happens, and the results are usually just pathetic. A simple project (simple for any good SE) would often turn into a nightmare - with no end in sight.
    To prevent it, it is enough to have a few (sometimes one) capable persons strategically placed on key points - to prevent idiotic decisions.

    In my own experience, it takes significantly less time and effort to deliver elegant software to QA and Production than delivering a patchy, poorly-designed mess.
    There many grades in between.

    ALWAYS.
    NEVER SAY NEVER.

    They skip the design (the thinking) part!
    Design is a F-word in software development and should be prohibited and each developer that write it - fined. Code is design!
    But eliminating of design should not eliminate thinking, really, it should promote it.

    I am amazed that you are arguing with this! I usually see this kind of resistance from the people who try to justify their incompetence, but I can tell that you are clearly NOT one of those people.
    I guess you completely misunderstood me. I do not argue with your statement - it is an ideal goal in the ideal world. But we live - and work - now and here. And have to balance our desires with ours - and others - capabilities and capacities. So we always have to make compromises. Elegant is simple, but simple is not always elegant. And often we have to do with just simplicity and maintainability, but without elegance
    It went into QA, and for the first 2 weeks they had found no bugs! I know, it is unusual, and normally I do expect QA to find bugs in my code, but this was an easy project to me.)
    Not so much unusual - I have similar experiences. One system (store logistic) that I have developed circa 3 years ago runs bug-free on customer site from day one. There were only single complaint and even that after proper investigation was attributed to the peer system that has not properly implemented agreed protocol.

    with time constraints, requirements that were not clear, deadlines, and other external factors that would make "clean" design "unrealistic." It's all nonsense! It is always just an excuse incompetent people use.
    While they indeed like to use such arguments that do not necessarily make those arguments invalid. Another sample (yes, it was clear management error but it has nothing to do with software development as such). I was working in one company which has developed quite advanced fork-lifter control system (assignments selection, route optimization, monitoring, ...) for a customer. Not very big project, something like 2 months for 2 developers. Development was successfully finished about 10 day in advance. Then in a couple of day comes company owner and says - customer does not wont fork-lifter control system any more, he wants access control system instead. And to the same deadline.

    So we converted first system to second one. You may understand that a lot of elegance was sacrificed (while about 80 percent of code was reused).

    Anyone who is competent, who is capable of producing quality software will tell you that thoughtful, elegant, and clean solutions always ensure a faster delivery.
    Do not agree - better software, yes, for sure. Faster delivery - probably, not.
    Yes, it will be faster comparing to messy, spaghetti-style software, but not in comparison which was intentionally developed as intentionally reasonable compromise of driving forces. To find such degree of compromise is some kind of art by itself.

    There are bad, messy solutions.
    There are perfect, nice, elegant solutions.
    And there are solutions that are not perfect, but are "good enough".

    If take in my previous analogy with armorer and smith - there is Excalibur and there is plow.


    They also ensure minimal maintenance costs throughout the life-cycle of the software.
    Such elegant solutions tend to have one major drawback - rely on some set of basic assumptions and while these assumptions are hold such solutions are very easy to maintain, but as soon as one of the assumptions is broken it becomes as bad as any messy system if not worse, Often complete redevelopment is required.

    I hope we are done discussing this...
    Seems so. But if you want to continue, then better in the private messages or emails as it clearly becomes off-topic.

  8. #18
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default

    Such elegant solutions tend to have one major drawback - rely on some set of basic assumptions and while these assumptions are hold such solutions are very easy to maintain, but as soon as one of the assumptions is broken it becomes as bad as any messy system if not worse, Often complete redevelopment is required.
    This is literally opposite to what I consider elegant. Elegance in software does not mean "pretty" with a cherry on top - at the cost of flexibility, reusability, and other essential parameters. It implies the adaptability and reasonable re-usability of the participating modules. If a small change in requirements causes a major re-work, it means the design is flawed. There's no elegance in it. It also implies such organization of your code that any changes would be localized, confined to as small part of the system as possible. If you were able to reuse 80% of your code after a major last minute change in requirements, that means good design to me.

    Finally, by "Design" I do not mean "Design Documentation". I mean mental processing of the task and working out the vision of the system, its major components, and how they fit together to ensure flexibility, adaptivity to ever-changing requirements, etc. Such Design is a never-stopping process that continues to go hand-in-hand with every line of code you write. It includes constant re-factorings. The initial design, to me, may involve a white-board session or two, a few scribbles on a piece of paper, putting together a few classes and developing/clarifying the idea and the vision as I go...

    Peace,
    C

  9. #19
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    If a small change in requirements causes a major re-work, it means the design is flawed. There's no elegance in it. It also implies such organization of your code that any changes would be localized, confined to as small part of the system as possible.
    You have heavily misinterpreted (or misunderstood) my words one more.
    I would try to explain once more - solutions that you name elegant are immune to minor and some not so minor (sometimes even major) requirement changes - save changes in some set of basic assumptions on which they are built. If one of this assumptions becomes broken, the whole system needs (practically) complete redevelopment or extremely ugly patching . If have selected that set of assumptions properly, you won, but if not, then you in much bigger trouble then with "good enough" and, probably, even with the"the mess from the start" system. And exactly selection of this set is the most complicated part of the software development, as your customers may 10 times confirm "this or that can not never, ever occur, it just impossible" but then in few months it becomes clear that there are situations when "this or that" occurs regularly.

    Finally, by "Design" I do not mean "Design Documentation". I mean mental processing
    But in SW design has some other stable meaning. So if you always says table meaning chair there are slim chances that you would be understood properly.

    Cheers,
    Oleksandr

  10. #20
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default

    solutions that you name elegant are immune to minor and some not so minor (sometimes even major) requirement changes ...
    And what... it is better if your solution breaks if you change one tiny little thing?

    - save changes in some set of basic assumptions on which they are built. If one of this assumptions becomes broken, the whole system needs (practically) complete redevelopment or extremely ugly patching .
    This is where your mind-boggling, incomprehensible talent for demagogy kicks in again! Which hypothetical assumptions are you talking about? Have you no shame - to pull such empty, unsupported statements right out of your a$$? Oh, let me guess, you had once written software that was supposed to be working on a space shuttle, but one day before the deadline, the manager asked you to convert it into a shopping cart application?? And this kind of twisted logic is supposed to make me believe that it is safer and more practical to forgo programming discipline and good structure in favor of all-in-a-big-pile applications with no "basic assumptions", whatever the hell that means?

    But in SW design has some other stable meaning. So if you always says table meaning chair there are slim chances that you would be understood properly.
    No! The word "Design" in the English language - as well as in Software Engineering - does not mean "Documentation". But, I am sure you'd be happy to school me on the English language as well...

    Oleksandr, you seem to favor arguing only for the sake of expressing a strong opinion that contradicts someone else's point, almost regardless of what they are saying. (No doubt, people have told you that before!) Your arguments always follow the same pattern: you pick a statement or concept, then pretend that it was meant to be an absolute fact in 100% of all life situations, with no marginal conditions or exceptions, regardless of any contexts. Then you make an absurdly obvious point that there may be marginal cases when something else may be sufficient. Or, you provide your own inaccurate interpretation of what the other person is saying, and argue with that, and so on... So, I see no point in continuing this. All I know is that I have my ways of building software that have not let me down so far. And vouch for a disciplined approach that promotes elegance and minimizes complexity. I don't need to have a rigid definition of what all these concepts are. I define them based on common sense.

    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •