-
Replied To a Post in Which layer should we start with when building an application?
I agree with the above. It's just that, apart from some very technical library stuff, the biggest question mark is always "do we have a complete and correct spec?", and … -
Replied To a Post in Implementing Factory pattern
> I can simply keep the constructors as they are and in the employee's one do this Yes, that's what I intended! ps: When I mentioned "suitable accessors" for the … -
Replied To a Post in Implementing Factory pattern
Quickest solution is to have the list in the Employee superclass as a static member with suitable public accessors. The constructor for Employee can simply add `this` to the list. … -
Replied To a Post in Which layer should we start with when building an application?
I don't have time for a full reply now (I'll try later) but the short version is: Start with the API definitions for the distinct layers. Eg if its just … -
Replied To a Post in How To Make Quality Voronoi Diagrams
All very technical and graphical.but until you give me at least one practical use, I'm not interested -
Gave Reputation to Morphlinqq in Most effective programming language ?
Better start with assembly, then some php or python to see their advantages -
Replied To a Post in how to remove from a list.
If the deck is shuffled then it makes no difference which card you remove, so why not just remove the last one? (May make no difference in Python, but for … -
Replied To a Post in What is JDBC? What are different types of JDBC drivers ?
See [this](https://lmgtfy.com/?q=What+is+JDBC%3F+What+are+different+types+of+JDBC+drivers+%3F&s=g) -
Replied To a Post in Creating a simple REST application
Yes, your client has to parse the server's JSON to extract the relevant info (name of class to instantiate, values for its members) The idea behind the JSON format is … -
Replied To a Post in find all patterns
First you will need something to iterate through all the character sequences. See my previous post for hints about how to do that. (Out of interest I tried this myself. … -
Replied To a Post in Should I not using third party for development?
yes, affected Presumably you will have downloaded that library and incorporated it into your deliverable, so nothing that happens on GitHub will affect it. It it were removed I'd be … -
Replied To a Post in Creating a simple REST application
The basic process used by JSONObject, JASON, XMLDecoder etc is to create an empty instance of the target class using its no-args constructor, then use its `set` methods to inject … -
Replied To a Post in Creating a simple REST application
I see you are using JSONObject with it's horrible unchecked casts etc. Have fun with that! While you are coding this, keep in mind what you would have to do … -
Replied To a Post in Creating a simple REST application
well, yes. In my opinion you will learn a lot by going through the process of parsing the JSON and creating the objects. When you've done that try adding something … -
Replied To a Post in find all patterns
so basicallly you have m times n starting points for the first character for each of those you append the character in each of the (up to) 8 surrounding points … -
Replied To a Post in find all patterns
What are the constraints, eg 5 chars in a horizontal or vertical line? and diagonal? and any zig-zag snaking sequence? -
Replied To a Post in Creating a simple REST application
Great progress! The returned string should start with an HTTP return code, and the JSON needs to be passed as a mime type file - but these are HTTP details … -
Replied To a Post in Design a function named max
Exactly what trouble are you having? What help do you need? You say you have the code. Did you write it or is it just something random that you found … -
Replied To a Post in Creating a simple REST application
It's a lot lot simpler than that! Remember what's in the request? A string that identifies the kind of resource (ie its class) and the id. That's all. (The string … -
Replied To a Post in Creating a simple REST application
A couple of quick comments: no need for get/set server in client! Test: Soon after posting I edited the post to improve the test code to pass the resource class … -
Replied To a Post in Creating a simple REST application
> Do you mean that both CLient and Server classes will have to hold an object of type Product and Customer? They both need access to the class definitions. We … -
Replied To a Post in Creating a simple REST application
OK, let's have some fun. Here's some code that will create test environment for you to code against.. First here's a couple of data classes (JavaBeans compliant) class Customer { … -
Replied To a Post in File is not converted, string to file?
You have a complete path for the file, but you discard everything apart from the file name. So it will look for that file in the default directory. In all … -
Replied To a Post in Creating a simple REST application
Don't fake any of the parsing. Have two different resources and/or ids so you can test the parsing etc properly -
Replied To a Post in Creating a simple REST application
We're a maybe half way through "the basics" so keep going. As an absolute minimum go for: Client is passed a resource name and an ID (eg "Client:, 123). It … -
Gave Reputation to Violet_82 in Creating a simple REST application
OK, so I've done it as above but then I added some spaces here and there, so ended up with this in the Client class (the main class is as … -
Replied To a Post in Creating a simple REST application
Obviously there's more than one way to go, but I personally would do something very much like that. I'm thnking about how it would fit into a bigger context. For … -
Replied To a Post in Creating a simple REST application
If you look at that complete string it’s all simple characters and can be parsed by splitting on blanks... except for the URL that may contain all kinds of stuff … -
Replied To a Post in Creating a simple REST application
The request URL needs to be encoded (it may contain blanks etc), but not the whole request. I believe URLEncoder will deal with the character set, so lines 24,25 are … -
Replied To a Post in Creating a simple REST application
The server MUST construct the JSON string with names, brackets etc. to return to the client It may delegate it to other classes of course, but it is repsonsible for … -
Replied To a Post in HDD to SSD, not compatible
Have you tried it in another machine or external box in case the SSD is faulty? -
Replied To a Post in Creating a simple REST application
Your request string is incomplete - see the examples linked earlier. The URL should be UTF-8 encoded and % encoding all non alphanumerics The returned value must be in a … -
Replied To a Post in Creating a simple REST application
Yes. The URL can be simple if the context is known, eg GET CLIENT/123 Don't forget that the URL part should be UTF-8 encoded. If you `accept application/json` then it's … -
Replied To a Post in Creating a simple REST application
That's going in the right direction. Now you need to do the REST formating and encoding so that all you pass to the server is a single string and all … -
Gave Reputation to Saboor880 in why am i getting empty list when i call it from another class?
Make your list static and then populate it in Mange class. Now you will be able to access this List in your scan class. -
Gave Reputation to Saboor880 in why am i getting empty list when i call it from another class?
Make your list static and then populate it in Mange class. Now you will be able to access this List in your scan class. -
Replied To a Post in Creating a simple REST application
OK so far (despite a load of unneeded getters and setters!) (see below) Because you will be passing the messages by simple method calls you do not need any http … -
Replied To a Post in Creating a simple REST application
Yes. If you are learning about REST messages then it doesn't matter how the messages are sent and received, so passing them in ordinary method calls is the simplest way … -
Replied To a Post in Java "Argot" Translator Help
Aha! Just spotted it... You open a second Scanner using the same input stream in your translator method. That "steals" the stream from the first scanner, so the first scanner … -
Replied To a Post in Java "Argot" Translator Help
It would be uselful to print `option` before the `switch`. But line 11 you have an assignment where you should have a equals test,. And even if you fix that … -
Replied To a Post in Java "Argot" Translator Help
Without seeing the code its impossible to say what's wrong with it! -
Replied To a Post in Java "Argot" Translator Help
> My comment is to think defensively when coding as above. I think the code will fail with null strings so some check would be needed to avoid that in … -
Replied To a Post in Java "Argot" Translator Help
The truth is that a minute spent thinking before coding saves ten minutes debugging after coding. It doesn't have to be complicated or formal. Personally I start by coding my … -
Replied To a Post in Creating a simple REST application
In the real world you would probably use somethinhg like Spring to implement a real application. But to work with Spring (etc) you need a reasonable understanding of what it's … -
Replied To a Post in Java "Argot" Translator Help
Yeah. I would just move on now, and remember that Scanner nextInt and nextLine don't mix well! -
Replied To a Post in Java "Argot" Translator Help
It's a well-known problem with Scanner's design - so many people fall into this trap. your `nextInt` reads the menu number, leaving its newline character in the input buffer. The … -
Replied To a Post in Creating a simple REST application
Java is a perfectly sensible language for this - no problem. I was suggesting that you code it yourself (in the language of ypur choice) rather than starting with any … -
Replied To a Post in Creating a simple REST application
That seems backewards to me. For a first learning exercise in REST maybe it would be better to start with the essential univeral REST components - a Client and a … -
Replied To a Post in Sorting ArrayList with a comparator, how to
> those two overriden methods are not doing anything, My point was not that they were not used, it was that they are not overriding anything. -
Replied To a Post in Sorting ArrayList with a comparator, how to
Yes. Probabuy the nicest way to do this is to use `Comparator.comparing` with a Java 8 lambda eg Collections.sort(employeeCollection, Comparator.comparing(Employee::getName)); (although personally I would be tempted to` import static` so …
The End.